Wednesday, January 30, 2013

getting same order in SQL as ManytoMany selection in Admin

I have a Django/Grappelli admin form for job postings which has a manytomany relationship for job requirements (using filter_horizontal).  In the admin form, the order chosen stays constant when I save the job posting and display it again later.  I'm trying to repeat the order in another app that selects the job requirements using the join table, but no matter which column I ORDER BY (or even if I don't use an ORDER BY) in the SQL, I cannot get the same order of job requirements as displayed in the admin form.

Any idea how the chosen items retain their selected order?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment