summaryrefslogtreecommitdiff
path: root/docs/db-api.txt
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-06-09 14:08:14 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-06-09 14:08:14 +0000
commitb792044d34171888938dfac833ee4263745c1eef (patch)
tree91211094ec4697d311ed2de4f93fec79bf790130 /docs/db-api.txt
parent8d30cdc2672175c77319756b42b12103e1efd350 (diff)
downloaddjango-b792044d34171888938dfac833ee4263745c1eef.tar.gz
unicode: Merged from trunk up to [5443].
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5444 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
-rw-r--r--docs/db-api.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt
index 376cc69822..cd3a115282 100644
--- a/docs/db-api.txt
+++ b/docs/db-api.txt
@@ -134,6 +134,15 @@ the database until you explicitly call ``save()``.
The ``save()`` method has no return value.
+Updating ``ForeignKey`` fields works exactly the same way; simply assign an
+object of the right type to the field in question::
+
+ joe = Author.objects.create(name="Joe")
+ entry.author = joe
+ entry.save()
+
+Django will complain if you try to assign an object of the wrong type.
+
How Django knows to UPDATE vs. INSERT
-------------------------------------
@@ -1229,8 +1238,8 @@ whose ``headline`` contains ``'Lennon'``::
Blog.objects.filter(entry__headline__contains='Lennon')
-Escaping parenthesis and underscores in LIKE statements
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Escaping percent signs and underscores in LIKE statements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The field lookups that equate to ``LIKE`` SQL statements (``iexact``,
``contains``, ``icontains``, ``startswith``, ``istartswith``, ``endswith``