mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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
@@ -50,3 +50,21 @@ class UnmigratedModel(models.Model):
|
||||
if its migrations directory has not been repointed)
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class FoodQuerySet(models.query.QuerySet):
|
||||
pass
|
||||
|
||||
|
||||
class BaseFoodManager(models.Manager):
|
||||
def __init__(self, a, b, c=1, d=2):
|
||||
super(BaseFoodManager, self).__init__()
|
||||
self.args = (a, b, c, d)
|
||||
|
||||
|
||||
class FoodManager(BaseFoodManager.from_queryset(FoodQuerySet)):
|
||||
use_in_migrations = True
|
||||
|
||||
|
||||
class NoMigrationFoodManager(BaseFoodManager.from_queryset(FoodQuerySet)):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user