Open andrew-gibson opened 1 week ago
Hi @andrew-gibson, thank you for reporting this! I'll see if I can reproduce this with a test case when I get some time.
@j4mie thanks for the reply, i'm sure there was a move professional way of submitting this. Would you like me to submit a file which highlights where it falls down?
No, that's absolutely fine - the example you gave should be plenty. Thanks again.
take the case of :
in qs.py, when resolving a where a model has a relationship with
ProxyModel,
the code currently traverses::related_descriptor.rel.field.model
however, if the related model isProxyModel
, then this resolution path ends up withCoreModel
If you instead follow:
related_descriptor.rel.model._meta.proxy
, you can check if it's a proxy model and thenrelated_queryset = related_descriptor.rel.model.objects.all()
will get you the right qs