Add multiple trash can support, restoring and complete source object manager and queryset method substitution

This commit is contained in:
Roberto Rosario
2012-08-07 01:42:44 -04:00
parent 332156b590
commit c304d1ed27
14 changed files with 288 additions and 34 deletions

14
apps/common/querysets.py Normal file
View 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)