Hello,
In my admin interface, the data isn't ordered as expected. What I get
is:
Provincie/Land Type
Limburg Provincie
Groningen Provincie
Utrecht Provincie
etc.
which clearly isn't alphabetical order, while I do specify that
provinces should be ordered that way. In my python manage.py shell the
provinces are ordered alphabetically. What could be wrong?
admin.py:
class ProvinceAdmin(admin.ModelAdmin):
list_display = ('name', 'type')
actions = None
admin.site.register(Province, ProvinceAdmin)
models.py:
class Province(models.Model):
TYPES = (
('c', 'Land'),
('p', 'Provincie'),
)
name = models.CharField(max_length=200, verbose_name="Provincie/
Land")
type = models.CharField(max_length=1, choices=TYPES, default='c')
def __unicode__(self):
return self.name
class Meta:
ordering = ('-type', 'name',)
verbose_name = 'Provincie/Land'
verbose_name_plural = 'Provincies/Landen'
For the record, I am using django trunk revision 12295 .
- Wim
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.