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`.`email`,
`appointments_doctor`.`phone`, `appointments_doctor`.`qualifications`,
`appointments_doctor`.`about`, `appointments_doctor`.`specialities`,
`appointments_doctor`.`department`, `appointments_doctor`.`fees`,
`appointments_doctor`.`displayfee`, `appointments_doctor`.`slotrange`,
`appointments_doctor`.`slotdurn`, `appointments_doctor`.`breakrange`,
`appointments_doctor`.`slotsleft` FROM `appointments_doctor` WHERE
`appointments_doctor`.`name` LIKE %joel%


Sincerely yours,

Dr Joel G Mathew



On 11 August 2018 at 11:25, Jason <jjohns98...@gmail.com> wrote:
> 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.objects.filter(name__icontains = 'joel')
> print(doctors.query)
>
> It should have something like
>
> SELECT ... FROM ... WHERE name ILIKE  '%joel%';
>
> which should do the case insensitive search.
>
> Otherwise, this is a database issue, and not a django issue.  Django just
> converts the filter call to the appropriate SQL and has the db execute it.
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2b8dd9eb-b1ab-4eaf-ac17-4f03c1ed1c2c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA%3Diw_8E0NcRCU142f6eRBTSrmuj9nrG2n8DSXV_-PaGAWwqyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to