Re: Unexpected behavior with icontains in query filter

2018-08-11 Thread Jason
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

Re: Unexpected behavior with icontains in query filter

2018-08-11 Thread Joel Mathew
sers@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 wit

Re: Unexpected behavior with icontains in query filter

2018-08-11 Thread Joel Mathew
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`,

Re: Unexpected behavior with icontains in query filter

2018-08-11 Thread ireoluwa fakeye
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

Re: Unexpected behavior with icontains in query filter

2018-08-11 Thread Jason
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 =

RE: Unexpected behavior with icontains in query filter

2018-08-10 Thread Matthew Pava
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 a fie

Unexpected behavior with icontains in query filter

2018-08-10 Thread Joel
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)