Ticket #15884: ticket_15884-patch_1.diff
File ticket_15884-patch_1.diff, 948 bytes (added by , 14 years ago) |
---|
-
django/core/management/validation.py
40 40 e.add(opts, '"%s": You can\'t use "id" as a field name, because each model automatically gets an "id" field if none of the fields have primary_key=True. You need to either remove/rename your "id" field or add primary_key=True to a field.' % f.name) 41 41 if f.name.endswith('_'): 42 42 e.add(opts, '"%s": Field names cannot end with underscores, because this would lead to ambiguous queryset filters.' % f.name) 43 if f.primary_key and f.null: 44 e.add(opts, '"%s: Primary key fields do not accept null values.' % f.name) 43 45 if isinstance(f, models.CharField): 44 46 try: 45 47 max_length = int(f.max_length)