On Nov 16, 4:31 pm, Zeynel <azeyn...@gmail.com> wrote:
> Thanks!
>
> I noticed that using
>
> class Lawyer(models.Model):
>     ...
>     ordering = ('last',)
>
> did not work.
>
> But this worked
>
> class Lawyer(models.Model):
>     ...
>     class Meta:
>         ordering = ('last',)
>
> copied fromhttp://www.djangoproject.com/documentation/models/ordering/
>
> What is the correct way actually?

You weren't reading closely enough. The page Karen linked you to is
all about admin options, and that option therefore belongs on the
ModelAdmin class, not the model itself. The other page explains how
you set the default ordering for a model throughout the application,
which the admin will also use if it doesn't have anything else set.
--
DR.

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to