You can set a value in a model and order_by that value.
I presume you're trying to optimize something, and don't
want to have
the overhead of order_by for each call.
Ivan
On Jan 21, 1:15 am, J. Pablo Fernández <pup... pupeno.com> wrote:
> Hello,
>
> Is there some tool in Django to make a model an ordered
list where a
> position field is stored in the database and methods
like move_up() or
> move_down() do the right thing?
>
> If not, how would I go about doing it so it is
reusable? a class to inherit
> from in model classes (as the second class to inherit
from)?
>
> Thanks.
> --
> J. Pablo Fernández <pup... pupeno.com> (http://pupeno.com)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|