Ticket #861: 861.diff
File 861.diff, 1.0 KB (added by , 19 years ago) |
---|
-
django/core/management.py
85 85 if opts.order_with_respect_to: 86 86 table_output.append('%s %s NULL' % (db.db.quote_name('_order'), db.DATA_TYPES['IntegerField'])) 87 87 for field_constraints in opts.unique_together: 88 assert not isinstance(field_constraints, basestring), \ 89 "Illegal unique_together. Try putting your lists of fields in another list, e.g. [%s]" % repr(opts.unique_together) 88 90 table_output.append('UNIQUE (%s)' % \ 89 91 ", ".join([db.db.quote_name(opts.get_field(f).column) for f in field_constraints])) 90 91 92 full_statement = ['CREATE TABLE %s (' % db.db.quote_name(opts.db_table)] 92 93 for i, line in enumerate(table_output): # Combine and add commas. 93 94 full_statement.append(' %s%s' % (line, i < len(table_output)-1 and ',' or ''))