You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I add the field to individuals__first_name to the client ClientAccountFilterSetMetafields like the following. I passes through the validation.
class ClientAccountFilterSet(FilterSet):
individuals = RelatedMultipleFilter(IndividualFilterSet, queryset=Individual.objects.all())
class Meta:
model = ClientAccount
fields = {
"is_lead": ["exact"],
"user_reference": ["exact", "icontains"],
"individuals__first_name": ["exact", "icontains"],
}
As far as I understand when using related filter I should not have to specify all the properties within the related class in the filter because that is already specified in the IndividualFilterSet. Like the case of the Individual.first_name.
Any help on this is much appreciated.
The text was updated successfully, but these errors were encountered:
petrosschilling
changed the title
Invalid filter for properties of model of RelatedFilter
Invalid filter for properties of model of RelatedMultipleFilter
Oct 22, 2020
Version: 1.0.0.dev2
Python version: 3.6.11
Other dependencies:
Django==3.0
django-cors-headers==3.5.0
django-filter==2.4.0
django-hashid-field==3.1.3
djangorestframework==3.11.1
djangorestframework-filters==1.0.0.dev2
djangorestframework-jsonapi==3.2.0
djangorestframework-simplejwt==4.4.0
dry-rest-permissions==0.1.10
I know I'm using a dev version but i'm putting the issue here for the record.
I have the following structure:
But when making a get request on
/client_accounts/?filter[individuals.first_name]=Tes
I get the following error:If I add the field to
individuals__first_name
to the clientClientAccountFilterSet
Meta
fields
like the following. I passes through the validation.As far as I understand when using related filter I should not have to specify all the properties within the related class in the filter because that is already specified in the
IndividualFilterSet
. Like the case of theIndividual.first_name
.Any help on this is much appreciated.
The text was updated successfully, but these errors were encountered: