django-elasticsearch-dsl icon indicating copy to clipboard operation
django-elasticsearch-dsl copied to clipboard

get_instances_from_related for 2 model fields on same ForeignKey

Open kavehcs opened this issue 5 years ago • 3 comments

hello. how to code "get_instances_from_related" for The following models : I want to index the "inject_type" model :

class myModel(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='inject_user' , null=True) which_user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='request_user' , null=True)

class inject_type(models.Model): myModel_field = models.ForeignKey(myModel, related_name='inject_type' , null=True)

thanks.

kavehcs avatar Aug 19 '19 07:08 kavehcs

Any solution found for this? I have the same use case.

phoebebright avatar Dec 21 '19 16:12 phoebebright

I have the same problem, any solution one year later ?

qcoumes avatar Feb 17 '21 16:02 qcoumes

No solution yet. One year after.

Blazskills avatar Jul 23 '22 14:07 Blazskills