Simplified the indent level in management.py _get_sql_model_create() by using a 'continue' statement rather than nesting everything in an 'if'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ac2b9f2a3f
commit
0827f4ac7e
|
@ -161,7 +161,10 @@ def _get_sql_model_create(model, known_models=set()):
|
||||||
for f in opts.fields:
|
for f in opts.fields:
|
||||||
col_type = f.db_type()
|
col_type = f.db_type()
|
||||||
tablespace = f.db_tablespace or opts.db_tablespace
|
tablespace = f.db_tablespace or opts.db_tablespace
|
||||||
if col_type is not None:
|
if col_type is None:
|
||||||
|
# Skip ManyToManyFields, because they're not represented as
|
||||||
|
# database columns in this table.
|
||||||
|
continue
|
||||||
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
|
# Make the definition (e.g. 'foo VARCHAR(30)') for this field.
|
||||||
field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
|
field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
|
||||||
style.SQL_COLTYPE(col_type)]
|
style.SQL_COLTYPE(col_type)]
|
||||||
|
|
Loading…
Reference in New Issue