Ticket #1972: management.diff
File management.diff, 818 bytes (added by , 18 years ago) |
---|
-
management.py
456 456 for app in models.get_apps(): 457 457 model_list = models.get_models(app) 458 458 for model in model_list: 459 # If the model has no fields, throw an error. 460 if len(model._meta.fields) == 1 and model._meta.fields[0].get_internal_type() == 'AutoField': 461 raise ImproperlyConfigured, "model '%s' in application '%s' has no fields; models must have at least one explicit non-primary-key field" % (model._meta.object_name, model._meta.app_label) 459 462 # Create the model's database table, if it doesn't already exist. 460 463 if model._meta.db_table in table_list: 461 464 continue