-
Notifications
You must be signed in to change notification settings - Fork 159
Use two managers in one model #270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need to create new Manager class that inherits from both class PlaceManager(InheritanceManager, OrderedModelManager)
...
class Place(models.Model):
# ...
objects = PlaceManager() |
I have tried this method. If I try to move the object in the admin, I got an error: AttributeError at /admin/myapp/place/6/move-top/ |
You need to overload to queryset as well. And this queryset should be subclass of OrderedModelQueryset |
error: AttributeError |
You should've created new QuerySet that inherits |
Hi!
I have a Place model with subclasses Restaurant and Bar. I attached InheritanceManager from django-model-utils to Place to use the select_subclasses() method to get instances of the subclass.
Everything worked fine. But now I want to set the order of the model Place.
How to combine them?
Thanks.
The text was updated successfully, but these errors were encountered: