#23694: Swappable Dependency should not use "__first__"
-------------------------------+--------------------------------------
Reporter: Richard Eames | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.7
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Shai Berger):
* cc: Shai Berger (added)
Comment:
Quoting myself from the duplicate ticket:
> Another solution may be to load the app's migrations and look for a
suitable {{{CreateModel}}} operation. That is not ideal, because models
can be created by other operations (obviously the built-in
{{{RenameModel}}}, but even an {{{AddField}}} with a M2M, not to mention
3rd-party operations). \\ \\
> A different approach would be just to check -- when a swappable
dependency is in place, after running the initial migration of the
dependency app, verify that the requested model exists, and if it doesn't,
error out. That may later be extended, by allowing a specific migration to
be marked (explicitly, in its code) as providing a specific model, but
that extension may well be a YAGNI.
The above may justify reopening the ticket, as I believe it provides a
partial answer to Andrew's comment:2 asking for a way around the
limitations.
--
Ticket URL: <https://code.djangoproject.com/ticket/23694#comment:4>
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/010701887c15f61f-6dd3d3b9-c120-4c0e-803b-b85608190bd8-000000%40eu-central-1.amazonses.com.