Permalink
Browse files

Merge pull request #2333 from davesque/sql-doc-fixes

Capitalize SQL keywords
  • Loading branch information...
2 parents c03edb5 + adcedfe commit 476abc7ea72fc7cbfed8e5a7b50b5d82e5d32105 @alex alex committed Feb 20, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/topics/db/sql.txt
View
@@ -86,7 +86,7 @@ had ``Person`` data in it, you could easily map it into ``Person`` instances::
>>> Person.objects.raw('''SELECT first AS first_name,
... last AS last_name,
... bd AS birth_date,
- ... pk as id,
+ ... pk AS id,
... FROM some_other_table''')
As long as the names match, the model instances will be created correctly.
@@ -247,7 +247,7 @@ Note that if you want to include literal percent signs in the query, you have to
double them in the case you are passing parameters::
cursor.execute("SELECT foo FROM bar WHERE baz = '30%'")
- cursor.execute("SELECT foo FROM bar WHERE baz = '30%%' and id = %s", [self.id])
+ cursor.execute("SELECT foo FROM bar WHERE baz = '30%%' AND id = %s", [self.id])
If you are using :doc:`more than one database </topics/db/multi-db>`, you can
use ``django.db.connections`` to obtain the connection (and cursor) for a

0 comments on commit 476abc7

Please sign in to comment.