Code

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#800 closed defect (fixed)

startswith lookup type does not work with underscore

Reported by: django-form@… Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Quite strange. Using SQLite 3.2.7, django r1238.

>>> for i in attributes.get_iterator(key__startswith = 'threaded'): print i
... 
threaded_collector.count
>>> for i in attributes.get_iterator(key__startswith = 'threaded_'): print i
... 
>>> 

I also tested with foo_ and foo and it exhibited the same behaviour.

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by adrian

  • Status changed from new to assigned

This is a SQLite problem...I've reproduced it in upcoming unit tests.

comment:2 Changed 9 years ago by adrian

(In [1324]) Added unit tests to verify #800. Refs #800

comment:3 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [1326]) Fixed #800 -- Fixed bug in treatement of underscores and percent signs in SQLite backend. In order to do this, changed OPERATOR_MAPPING in DB backends to include a format string of the field value, because ESCAPE comes after the field value.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.