Django Code wrote: > #7101: ordering ForeignKey(self) =FieldError: Infinite loop caused by > ordering. > -----------------------------------------------------+---------------------- > Reporter: Carl Karsten <[EMAIL PROTECTED]> | Owner: > nobody > Status: closed | Component: > Core framework > Version: SVN | Resolution: > invalid > Keywords: | Stage: > Unreviewed > Has_patch: 0 | Needs_docs: > 0 > Needs_tests: 0 | Needs_better_patch: > 0 > -----------------------------------------------------+---------------------- > Changes (by mtredinnick): > > * status: new => closed > * needs_better_patch: => 0 > * resolution: => invalid > * needs_tests: => 0 > * needs_docs: => 0 > > Comment: > > That code was already broken, but you just hadn't noticed. Django is now > correctly reporting the error. If you order by the parent, then the > parents should be order by their parents and so on. Since that's > impossible to encode in SQL, previous versions of Django were returning > only a single level of ordering, which was very inconsistent. > > Either remove the infinite loop or use `order_by('parent_id')` if you want > a workaround to simulate the previous ambiguous behaviour. >
order_by('parent_id') doesn't do anything for the Admin UI, which is where I 'need' this. I can probably live without it, but the previous behavior grouped siblings (child with same parent) together, and put the 'root nodes' (no parent) at the top. This was handy. I can now kinda get this behavior by using the list_filter = ('parent',) but so far I am finding that awkward. I think the nature of a site's menu is such that the previous was useful, but I can see that it wouldn't make any sense for a larger dataset. So, anyone have any suggestions on how to create something similar? Carl K --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---