Opened 4 years ago

Last modified 20 months ago

#27080 assigned New feature

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

Reported by: Leif Denby Owned by: Oliver Newman
Component: Migrations Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no


When using the convenience method as_manager on a QuerySet the attribute is_in_migrations ( 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 (4)

comment:1 Changed 4 years ago by Tim Graham

Needs tests: set
Triage Stage: UnreviewedAccepted

The PR needs a test.

comment:2 Changed 21 months ago by Oliver Newman

Owner: changed from nobody to Oliver Newman
Status: newassigned

I have a tested fix for this, about to submit a PR if such a change is still welcome.

comment:3 Changed 21 months ago by Oliver Newman

Component: Database layer (models, ORM)Migrations
Type: BugNew feature
Version: 1.10master

comment:4 Changed 20 months ago by Simon Charette

Patch needs improvement: set

PR still needs to test migration serialization of querysets or queryset generated managers.

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