#10070: Named parameters not working on raw sql queries with sqlite
---------------------------------------------------+------------------------
Reporter: msurdi | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Comment (by [email protected]):
I've attached a different fix
([http://code.djangoproject.com/attachment/ticket/10070/base.diff]) for
this (though similar in places to msurdi's). Sorry about the annonymous
user on the attachement, but I didn't see how to combine it with this.
It should be faster in the apparently more common case of supplying a
sequence, since the only extra overhead is the try block setup.
Also, since the text replacement is done by the format operator itself,
I'm more confident that the result will be correct, where I have to worry
about missing the fact that a percent sign is quoted when using the
regular expression replace approach of the original patch.
A hint if anyone doesn't find the colonifier to be obvious: the format
operator only cares that its right operand has a __getitem__ method.
(Tested with python versions 2.4 and 2.6.)
This now allows my PostgreSQL developed mapping queries to work with
sqlite3 (Django-1.0.3, python 2.6).
Sadly, I have no test.py code to offer.
Bill
--
Ticket URL: <http://code.djangoproject.com/ticket/10070#comment:7>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---