I'll suggest the sortable <ul> in ui.jquery.com for front end. On
ordering you may want to run some serialize function in JavaScript and
submit with AJAX to a function that writes the order. Another flavor
is to simple put move_up and move_down functions to your model. There
is an example of this on djangosnippets.org. You could bridge the
sortable UI component by just submitting how many places to move a
particular row down/up. This would scale better as you're only posting
two values (object id and positions up/down) and not a huge array that
triggers a SQL for every row. You may want to think about pagination
as well. I'm not sure how I would accomplish sortable lists with very
large datasets. The solution depends on the scale I suppose.

On Jan 1, 10:42 pm, hedronist <[EMAIL PROTECTED]> wrote:
> > Would a separate model be appropriate to accomplish this?
>
> Perhaps. You didn't say how large the data set is. If there is only
> one ordering, then simply having an additional integer field on the
> model might be more useful. That way you can do something like:
>
>    objs = mymodel.objects.order_by('my_ordering_field')
>    for obj in objs:
>       <do something>
>
> As far as ordering things (again, assuming that things fit on one web
> page), you might look at:
>
> http://interface.eyecon.ro/docs/sort
> orhttp://tool-man.org/examples/sorting.html
>
> Both of which do javascripty things with lists. When done, just ship
> the final ordering back to the server.
>
> Good Luck
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to