List Info

Thread: Re: Models that are ordered lists




Re: Models that are ordered lists
user name
2008-01-21 18:27:17
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-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )