Hello I want to check if a value exists in an ArrayField in the views.
Right now i’m doing this query:
context['list'] = Customers.objects.filter(Q(postalcode__icontains = postalRepresentativeObject.postalCodes) | Q(postalcode__gte = postalRepresentativeObject.beginPostalRange) & Q(postalcode__lte = postalRepresentativeObject.endPostalRange))
postalcode contains 2580
postalRepresentativeObject.postalCodes contains {2580, 2570, 2540}
postalRepresentativeObject.beginPostalRange contains 2580
postalRepresentativeObject.endPostalRange contains 3000
I just want to check if 2580 is inside the ArrayField object?
Thanks