Skip to content

select_related issue #641

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

Open
Krzy65siek opened this issue May 2, 2025 · 0 comments
Open

select_related issue #641

Krzy65siek opened this issue May 2, 2025 · 0 comments

Comments

@Krzy65siek
Copy link

In setup:

class Printer(PolymorphicModel):
...

class LargeFormatPrinter(Printer):
....

class PrintMode(models.Model):
printer = models.ForeignKey(Printer)

query = PrintMode.objects.all().select_related('printer)

query[0].printer always refer to base class. Am I doing something wrong? Or select_related breaks inheritance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant