Swappable dependency breaks if swappable model not in first migration of its app
|Reported by:||Stephen Burrows||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Right now, it's impossible to declare a dependency to/from AUTH_USER_MODEL.
Here's the error I'm getting:
ValueError: Lookup failed for model referenced by field feedback.FeedbackItem.user: brambling.Person
This is bad on two fronts:
- From the "brambling" side - the side declaring/using an AUTH_USER_MODEL - I can't use the "feedback" module because it doesn't declare a dependency on my model - and django doesn't currently support reverse dependencies (unless they're undocumented.)
- From the "feedback" side - the side with migrations and a swappable FK - the app can't be used by anyone who actually has a swappable model, because there's no way to declare a correct migration dependency.
I feel like the correct fix here would be to have a 'swappable dependency'.
This is on stable/1.7.x
Change History (8)
comment:1 Changed 3 years ago by
|Summary:||Need a way to declare a dependency for AUTH_USER_MODEL. → Swappable dependency not working|
comment:2 Changed 3 years ago by
|Summary:||Swappable dependency not working → Swappable dependency breaks if swappable model not in first migration of its app|
comment:5 Changed 3 years ago by
|Severity:||Normal → Release blocker|
|Triage Stage:||Unreviewed → Accepted|