Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

many_to_one/related field name #121

Answered by Archmonger
numpde asked this question in Problem
Discussion options

I have a model Compiled with a foreign key to Module, declared as follows:

parent = models.ForeignKey(Module, ..., related_name="compiled")

With use_query, this fails because it attempts to fetch compiled_set, I believe, due to this line in utils:

prefetch_fields.append(f"{field.name}_set")

Maybe it should be

prefetch_fields.append(field.related_name or f"{field.name}_set")

?

You must be logged in to vote

Thanks. I've created a new issue for this and will fix shortly.

#122

Replies: 2 comments 1 reply

Comment options

Thanks. I've created a new issue for this and will fix shortly.

#122

You must be logged in to vote
1 reply
Comment options

This has been merged into main. Will be released with version 3.0.0 this weekend.

Answer selected by numpde
Comment options

Thank you.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /