#30435: __icontains NOT WORKING. URGENT!!!!!!!!!!!!!!!!!!!!!!! -------------------------------------+------------------------------------- Reporter: Diego | Owner: nobody Arturo Hernandez Fuentes | Type: Bug | Status: new Component: | Version: 2.1 Uncategorized | Severity: Normal | Keywords: Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- I have my query into validation to find if exist a duplicate name in my model
{{{ def validate_name(self, value): if not value: raise serializers.ValidationError('Proporciona un valor, por favor.') try: exist_name = FundingSource.objects.filter(name__iexact=value) # here is the error __icontains is NOT WORKING if len(exist_name) > 0: raise serializers.ValidationError('Este nombre ya fue usado, por favor proporciona otro valor.') # I need display this message in my console to be sure that exists a duplicate except Exception as e: pass else: return value }}} I have in my model Funding 1 Funding 2 Funding 3 Funding 4 Next, I tried to type `funding 1` to disallow me to create that name, but, the queryset display me <QuerySet []> Then, create new one item in my table. Funding 1 Funding 2 Funding 3 Funding 4 funding 1 So this is wrong, your __iexact is bad, so I need that Django developer team resolve this, now. It's urgent, please. What is the best way to develop __iexact or __icontains. Thanks My django version is 2.1.5 Django rest framework version = 3.9.0 -- Ticket URL: <https://code.djangoproject.com/ticket/30435> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/054.7f6465558e4c9e577c8797b3554fc88a%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.