Closed benred42 closed 9 years ago
Copied from kkellydesign's comment on issue #42 :
So, making MenuItemManager inherit from TreeManager instead of models.Manager fixes this bug, but will doing that likely cause other issues?
I looks like MPTT 0.4 -> 0.5 made this change https://github.com/django-mptt/django-mptt/blob/master/docs/upgrade.rst#042-to-055 It looks like MPTT expects .objects
to be a TreeManager
and I'm surprised we aren't seeing more problems with the current behavior. I think we should move forward with this change. There is a conflict in that both try to override get_queryset
and that will need be resolved.
It looks like it should be possible to replicate the principle behavior of the TreeManager get_queryset
method in our MenuItemManager. All it's really doing is ordering the queryset.
Attempting to delete an item from the admin's changelist fails because it uses treenav's MenuItemManager instead of MPTT's TreeManager. Deleting from the admin's change form, however, does work.