#31837: Possible manager migration bug
--------------------------------+--------------------------------------
Reporter: Gordon Wrigley | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Description changed by Gordon Wrigley:
Old description:
> If I understand managers and migrations correctly then the change in this
> commit https://github.com/tolomea/django-
> tutorial/commit/e5df712ef10be91cd2e5d28c9df48e33254a2b10 produces a bad
> migration.
>
> Specifically I expect the migration to include both managers but it omits
> the "objects" manager.
>
> This causes a problem in the followup data migration
> https://github.com/tolomea/django-
> tutorial/commit/90825038c55913d74a23b1c5c2ba35268d0a1367 where
> Question.objects isn't available leading to {{{AttributeError: type
> object 'Question' has no attribute 'objects'}}}
>
> I have observed this in 3.0.8 and 2.2.14 (where I first ran into it)
New description:
If I understand managers and migrations correctly then the change in this
commit https://github.com/tolomea/django-
tutorial/commit/e5df712ef10be91cd2e5d28c9df48e33254a2b10 produces a bad
migration.
Specifically I expect the migration to include both managers but it omits
the "objects" manager.
This causes a problem in the followup data migration
https://github.com/tolomea/django-
tutorial/commit/90825038c55913d74a23b1c5c2ba35268d0a1367 where
Question.objects isn't available leading to {{{AttributeError: type object
'Question' has no attribute 'objects'}}}
I have observed this in 3.0.8 and 2.2.14 (where I first ran into it)
Also I observed (on 2.2.14 didn't check this on 3.0.8) that adding objects
to the concrete model (or an additional abstract model in between) fixes
the problem.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31837#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.70ecd9524d180cb0400c35c6e27c6382%40djangoproject.com.