Opened 9 years ago

Closed 9 years ago

#25482 closed Bug (needsinfo)

Field lookup istartswith not showing results in django 1.8.4 with mysql 5.5.44

Reported by: Deepinder Singh Owned by: nobody
Component: Uncategorized Version: 1.8
Severity: Normal Keywords: istartswith
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According to documentation istartswith is Case-insensitive starts-with.

So following query should return results for names starting with keyword "wash":

>>> cities = City.objects.filter(name__istartswith="wash")

But what happens in actual is I am geting results only while using keyword "Wash":

>>> cities = City.objects.filter(name__istartswith="wash")
>>> cities
[]
>>> cities = City.objects.filter(name__istartswith="Wash")
>>> cities
[<City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington>, <City: Washington Court House>, <City: Washington Terrace>, <City: Washington, D.C.>, <City: Washingtonville>, <City: Washougal>]

Change History (2)

comment:2 by Tim Graham, 9 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top