Ticket #861: 861.diff

File 861.diff, 1.0 KB (added by garthk, 13 years ago)

Patch with descriptive error

  • django/core/management.py

     
    8585        if opts.order_with_respect_to:
    8686            table_output.append('%s %s NULL' % (db.db.quote_name('_order'), db.DATA_TYPES['IntegerField']))
    8787        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)
    8890            table_output.append('UNIQUE (%s)' % \
    8991                ", ".join([db.db.quote_name(opts.get_field(f).column) for f in field_constraints]))
    90 
    9192        full_statement = ['CREATE TABLE %s (' % db.db.quote_name(opts.db_table)]
    9293        for i, line in enumerate(table_output): # Combine and add commas.
    9394            full_statement.append('    %s%s' % (line, i < len(table_output)-1 and ',' or ''))
Back to Top