-
-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support %(app_label)s
and %(class)s
in related_name
#737
Comments
OK so I narrowed this down to the fact that
Ideally I would like for us to just find a way to use |
Labelling a bug since we are a |
Haven't used this past an initial investigation but it does seem to be the solution:
|
As far as testing goes - would it be good enough to simply define an abstract and concrete implementation in the models? System checks seem to throw an error with a related name like |
@thenewguy if you want to take this on, I think the straightforward way would be to just edit one of the existing test models with a related name like what you are discussing, then we can add a quick test/modify an existing one to check that the related name accessor works. For example one of the models in this file, and editing a test. And of course for actually getting the bug fixed, just reworking the Would you be interested in making a PR with your changes? Even just having that as a starting point would be helpful. And if you're not interested, I can look at making a PR instead. But I think you understand the problem well |
I am trying to add
TaggableManager
to an Abstract model. I've added a related name likerelated_name='%(app_label)s_%(class)s_tags'
. This gives an error likeThe name '%(app_label)s_%(class)s_tags' is invalid related_name for field
withHINT: Related name must be a valid Python identifier or end with a '+'
Per the Django docs, this is a valid form of
related_name
.Shouldn't
TaggableManager
be performing the string format operation? At a glance this seems like it would work just fine with generic object taggingThe text was updated successfully, but these errors were encountered: