Add multiple trash can support, restoring and complete source object manager and queryset method substitution
This commit is contained in:
14
apps/common/querysets.py
Normal file
14
apps/common/querysets.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.db.models.query import QuerySet
|
||||
|
||||
from .managers import CustomizableQuerySetManager
|
||||
|
||||
|
||||
class CustomizableQuerySet(QuerySet):
|
||||
"""Base QuerySet class for adding custom methods that are made
|
||||
available on both the manager and subsequent cloned QuerySets"""
|
||||
|
||||
@classmethod
|
||||
def as_manager(cls, ManagerClass=CustomizableQuerySetManager):
|
||||
return ManagerClass(cls)
|
||||
Reference in New Issue
Block a user