mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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:
committed by
Tim Graham
parent
e37ab311fc
commit
aa5ef0d4fc
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user