carltongibson / django-filter

A generic system for filtering Django QuerySets based on user selections

Home Page:https://django-filter.readthedocs.io/en/main/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GenericRelation field not recognized as model field

MatejMijoski opened this issue · comments

I have a model which uses another table as a GenericRelation.

class Model(models.Model)
<...fields here>

generic = GenericRelation('throughModelname', ...)

On the view for this model, I declared:

filterset_fields = {
   "generic__id": ["exact", "in"]
}

but for some reason it doesn't recognize this field as a part of the model.

There's not really anything to go on here.

See #830 for a discussion of generic filtering.