Opened 15 months ago

Last modified 15 months ago

#27080 new Bug

`as_manager` on QuerySet should pass down `use_in_migrations` to new Manager instance

Reported by: Leif Denby Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When using the convenience method as_manager on a QuerySet the attribute is_in_migrations (https://docs.djangoproject.com/en/1.9/topics/migrations/#model-managers) is currently not passed down. This means that when creating a migration the Managers which a created from QuerySets won't be serialised into the migration. The current workaround would be to create Manager class from the QuerySet, thereby using the old approach where QuerySet.as_manager isn't used.

Change History (1)

comment:1 Changed 15 months ago by Tim Graham

Needs tests: set
Triage Stage: UnreviewedAccepted

The PR needs a test.

Note: See TracTickets for help on using tickets.
Back to Top