Fixed #23822 -- Added support for serializing model managers in migration

Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin,
Tim Graham, Carl Meyer, and others for their review and input.
This commit is contained in:
Markus Holtermann 2014-12-12 23:19:58 +01:00 committed by Tim Graham
parent e37ab311fc
commit aa5ef0d4fc
28 changed files with 608 additions and 48 deletions

View file

@ -60,9 +60,16 @@ class BaseCustomManager(models.Manager):
def manager_only(self):
return self.all()
CustomManager = BaseCustomManager.from_queryset(CustomQuerySet)
class DeconstructibleCustomManager(BaseCustomManager.from_queryset(CustomQuerySet)):
def __init__(self, a, b, c=1, d=2):
super(DeconstructibleCustomManager, self).__init__(a)
class FunPeopleManager(models.Manager):
def get_queryset(self):
return super(FunPeopleManager, self).get_queryset().filter(fun=True)