incuna / django-orderable

Add manual sort order to Django objects via an abstract base class and admin classes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filter Next/Previous by Relation

ghickman opened this issue · comments

next() & previous() methods on Orderable filter all orderable models so update them to take an optional relation and filter on.

Example

+1. It would be great to have models orderable by relation. That's my primary use case.

These methods now use get_filtered_manager() so they will respect Meta.unique_together. I think this can be closed.

I think that @mjtamlyn's patch does indeed fix this, @ghickman -- the example link is broken however, so please let me know if this should be reopened.