Ticket #1972: management.2.diff
File management.2.diff, 722 bytes (added by , 18 years ago) |
---|
-
management.py
819 819 e = ModelErrorCollection(outfile) 820 820 for cls in models.get_models(app): 821 821 opts = cls._meta 822 822 # Check the model. 823 if len(opts.fields) == 1 and opts.fields[0].get_internal_type() == 'AutoField': 824 e.add(opts, "model '%s' in application '%s': A model must have at least one explicitly declared field." % (cls._meta.object_name, opts.app_label)) 825 823 826 # Do field-specific validation. 824 827 for f in opts.fields: 825 828 if f.name == 'id' and not f.primary_key and opts.pk.name == 'id':