Thanks for the tip on the raw sql, I'll read the faq in more details.

On May 13, 5:53 am, Daniel Roseman <[email protected]>
wrote:
> On May 13, 2:25 am, Thierry <[email protected]> wrote:
>
> > My table has the following entry:
>
> > id      name
> > 1       foo's
>
> > I'm currently trying the following:
>
> > value = "foo's"
>
> > MyModel.objects.get(name = value)
>
> > The above is raising the exception DoesNotExist.  Doesn't the get
> > function automatically escape the single quote?  Is there also a way
> > to output the generated SQL of the above method?
>
> No, there's no 'escaping' for database lookups. Are you sure the
> element actually exists in the DB?
>
> You can see the code (as long as DEBUG=True) by doing:
> from django.db import connection
> connection.queries
> This is a FAQ, by the way.
> --
> DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to