On Nov 29, 4:50 pm, Continuation <selforgani...@gmail.com> wrote: > In the doc (http://docs.djangoproject.com/en/dev/ref/models/options/ > #order-with-respect-to) it is mentioned that order_with_respect_to > marks an object as "orderable" with respect to a given field. > > What exactly does that mean? Can someone give me an example of how > this could be used? > > The doc's example is: > order_with_respect_to = 'question' > > How is that different from > ordering = ['question']
order_with_respect_to uses the Question classes' ordering, where just ordering would use the string representation of that question. So using the example of questions and answers from the docs if Question had a 'sequence' field, and Question meta.ordering was set to use sequence, the answers would use that sequence. If using ordering instead of order_with_respect_to, then the questions would be in alphabetical question order. At least thats how I understand it. -Preston -- 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=en.