Skip to content

Use two managers in one model #270

@darbre

Description

@darbre

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.

from model_utils.managers import InheritanceManager


class Place(models.Model):
    # ...
    objects = InheritanceManager()

class Restaurant(Place):
    # ...

class Bar(Place):
    # ...

Everything worked fine. But now I want to set the order of the model Place.

...
objects = OrderedModelManager()
...

How to combine them?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions