mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
boulder-oracle-sprint: Merged to [5099]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5100 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -356,7 +356,7 @@ def get_sql_delete(app):
|
||||
# Drop the table now
|
||||
output.append('%s %s;' % (style.SQL_KEYWORD('DROP TABLE'),
|
||||
style.SQL_TABLE(backend.quote_name(model._meta.db_table))))
|
||||
if backend.supports_constraints and references_to_delete.has_key(model):
|
||||
if backend.supports_constraints and model in references_to_delete:
|
||||
for rel_class, f in references_to_delete[model]:
|
||||
table = rel_class._meta.db_table
|
||||
col = f.column
|
||||
@@ -902,7 +902,7 @@ def inspectdb():
|
||||
att_name += '_field'
|
||||
comment_notes.append('Field renamed because it was a Python reserved word.')
|
||||
|
||||
if relations.has_key(i):
|
||||
if i in relations:
|
||||
rel_to = relations[i][1] == table_name and "'self'" or table2model(relations[i][1])
|
||||
field_type = 'ForeignKey(%s' % rel_to
|
||||
if att_name.endswith('_id'):
|
||||
@@ -1609,7 +1609,7 @@ def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING, argv=None):
|
||||
action = args[0]
|
||||
except IndexError:
|
||||
parser.print_usage_and_exit()
|
||||
if not action_mapping.has_key(action):
|
||||
if action not in action_mapping:
|
||||
print_error("Your action, %r, was invalid." % action, argv[0])
|
||||
|
||||
# Switch to English, because django-admin.py creates database content
|
||||
|
||||
Reference in New Issue
Block a user