Changeset 7931
- Timestamp:
- 07/15/08 20:02:57 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/django/contrib/admin/validation.py
r7929 r7931 80 80 "well. Please either remove `?` or the other fields." 81 81 % cls.__name__) 82 if field == '?': 83 continue 82 84 if field.startswith('-'): 83 85 field = field[1:] 86 # Skip ordering in the format field1__field2 (FIXME: checking 87 # this format would be nice, but it's a little fiddly). 88 if '__' in field: 89 continue 84 90 _check_field_existsw('ordering[%d]' % idx, field) 85 91 django/branches/newforms-admin/tests/regressiontests/modeladmin/models.py
r7929 r7931 31 31 is_active = models.BooleanField() 32 32 pub_date = models.DateTimeField() 33 band = models.ForeignKey(Band) 33 34 34 35 class ValidationTestInlineModel(models.Model): … … 612 613 613 614 >>> class ValidationTestModelAdmin(ModelAdmin): 615 ... ordering = ('?',) 616 >>> validate(ValidationTestModelAdmin, ValidationTestModel) 617 618 >>> class ValidationTestModelAdmin(ModelAdmin): 619 ... ordering = ('band__name',) 620 >>> validate(ValidationTestModelAdmin, ValidationTestModel) 621 622 >>> class ValidationTestModelAdmin(ModelAdmin): 614 623 ... ordering = ('name',) 615 624 >>> validate(ValidationTestModelAdmin, ValidationTestModel)
