Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #24245 -- Added introspection for database defaults in the oracle backend. #7638

Merged
merged 1 commit into from Nov 30, 2016

Conversation

felixxm
Copy link
Member

@felixxm felixxm commented Nov 30, 2016

Ticket 24245. I added missing introspection for database defaults in the oracle backend.

SELECT column_name, data_default
FROM user_tab_cols
WHERE table_name = UPPER(%s)""", [table_name])
columns_default = {line[0]: line[1] if line[1] != 'NULL' else None for line in cursor.fetchall()}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using tuple unpacking such as ... for a, b, ... in cursor.fetchall() rather than indexing should help readability.

@@ -8,6 +9,8 @@
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text

FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If all bulit-in backends are adding 'default' now, might as well put it in the the base FieldInfo, I think.

@felixxm
Copy link
Member Author

felixxm commented Nov 30, 2016

I updated PR. Thanks for review.

@timgraham timgraham merged commit e17f40f into django:master Nov 30, 2016
@felixxm felixxm deleted the refs-24245-oracle branch November 30, 2016 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants