Check out https://code.djangoproject.com/ticket/9682. Apparently this is a
mysql specific thing.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+u
ngo-users@googlegroups.com [mailto:django-users@googlegroups.com]
> On Behalf Of Joel
> Sent: Friday, August 10, 2018 10:56 AM
> To: Django users
> Subject: Unexpected behavior with icontains in query filter
>
>
>
> I'm trying to do a case insensitive search for a sub
This is what I got:
In [8]: doct = doctor.objects.filter(name__icontains = 'joel')
...: print(doct.query)
SELECT `appointments_doctor`.`docid`, `appointments_doctor`.`name`,
`appointments_doctor`.`username`, `appointments_doctor`.`regid`,
`appointments_doctor`.`photo`, `appointments_doctor`.`e
The only reasonable explanation is Django sees only upper case inputs as
being case sensitive .so inputting a lower case and specifying icontains
wouldnt change anything .you could get your input from a form to confirm
On Fri., 10 Aug. 2018, 18:06 Joel, wrote:
> I'm trying to do a case insensit
Are you using sqlite for your db? if so, there are some notes about case
insensitive matching at
https://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching
otherwise, I'd be interested in seeing what your SQL is like
in your django shell, do the following:
doctors = Doctors.o
t;joel")
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Joel
Sent: Friday, August 10, 2018 10:56 AM
To: Django users
Subject: Unexpected behavior with icontains in query filter
I'm trying to do a case insensitive search for a substring within
I'm trying to do a case insensitive search for a substring within a field
in my model.
My model:
class doctor(models.Model):
docid = models.AutoField(primary_key=True, unique=True) # Need
autoincrement, unique and primary
name = models.CharField(max_length=35)
usern
7 matches
Mail list logo