2020-05-29 16:27:36 -04:00
|
|
|
from mptt.managers import TreeManager as TreeManager_
|
|
|
|
from mptt.querysets import TreeQuerySet as TreeQuerySet_
|
|
|
|
|
|
|
|
from django.db.models import Manager
|
|
|
|
from .querysets import RestrictedQuerySet
|
|
|
|
|
2023-04-14 10:33:53 -04:00
|
|
|
__all__ = (
|
|
|
|
'TreeManager',
|
|
|
|
'TreeQuerySet',
|
|
|
|
)
|
|
|
|
|
2020-05-29 16:27:36 -04:00
|
|
|
|
|
|
|
class TreeQuerySet(TreeQuerySet_, RestrictedQuerySet):
|
|
|
|
"""
|
|
|
|
Mate django-mptt's TreeQuerySet with our RestrictedQuerySet for permissions enforcement.
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class TreeManager(Manager.from_queryset(TreeQuerySet), TreeManager_):
|
|
|
|
"""
|
|
|
|
Extend django-mptt's TreeManager to incorporate RestrictedQuerySet().
|
|
|
|
"""
|
2020-07-23 12:48:03 -04:00
|
|
|
pass
|