diff --git a/django_cte/__init__.py b/django_cte/__init__.py index 7e833ef..4281378 100644 --- a/django_cte/__init__.py +++ b/django_cte/__init__.py @@ -1,6 +1,6 @@ from __future__ import absolute_import from __future__ import unicode_literals -from .cte import CTEManager, CTEQuerySet, With # noqa +from .cte import CTEModelMixIn, CTEManager, CTEQuerySet, With # noqa __version__ = "1.3.1" diff --git a/django_cte/cte.py b/django_cte/cte.py index 1572ebf..703886f 100644 --- a/django_cte/cte.py +++ b/django_cte/cte.py @@ -166,3 +166,7 @@ def from_queryset(cls, queryset_class, class_name=None): "models with CTE support need to use a CTEQuerySet") return super(CTEManager, cls).from_queryset( queryset_class, class_name=class_name) + +class CTEModelMixIn(): + """Model MixIn to inherit from, that has the Manager installed as 'objects'""" + objects = CTEManager() \ No newline at end of file