Fixed ReST bugs in [688]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-09-25 21:53:06 +00:00
parent c2e42e1c5c
commit 9e03747ebb
1 changed files with 9 additions and 9 deletions

View File

@ -33,7 +33,7 @@ Basic lookup functions
Each model exposes these module-level functions for lookups: Each model exposes these module-level functions for lookups:
get_object(**kwargs) get_object(\**kwargs)
-------------------- --------------------
Returns the object matching the given lookup parameters, which should be in Returns the object matching the given lookup parameters, which should be in
@ -41,14 +41,14 @@ the format described in "Field lookups" below. Raises a module-level
``*DoesNotExist`` exception if an object wasn't found for the given parameters. ``*DoesNotExist`` exception if an object wasn't found for the given parameters.
Raises ``AssertionError`` if more than one object was found. Raises ``AssertionError`` if more than one object was found.
get_list(**kwargs) get_list(\**kwargs)
------------------ ------------------
Returns a list of objects matching the given lookup parameters, which should be Returns a list of objects matching the given lookup parameters, which should be
in the format described in "Field lookups" below. If no objects match the given in the format described in "Field lookups" below. If no objects match the given
parameters, it returns an empty list. ``get_list()`` will always return a list. parameters, it returns an empty list. ``get_list()`` will always return a list.
get_iterator(**kwargs) get_iterator(\**kwargs)
---------------------- ----------------------
Just like ``get_list()``, except it returns an iterator instead of a list. This Just like ``get_list()``, except it returns an iterator instead of a list. This
@ -62,7 +62,7 @@ is more efficient for large result sets. This example shows the difference::
for obj in foos.get_iterator(): for obj in foos.get_iterator():
print repr(obj) print repr(obj)
get_count(**kwargs) get_count(\**kwargs)
------------------- -------------------
Returns an integer representing the number of objects in the database matching Returns an integer representing the number of objects in the database matching
@ -72,7 +72,7 @@ the given lookup parameters, which should be in the format described in
Depending on which database you're using (e.g. PostgreSQL vs. MySQL), this may Depending on which database you're using (e.g. PostgreSQL vs. MySQL), this may
return a long integer instead of a normal Python integer. return a long integer instead of a normal Python integer.
get_values(**kwargs) get_values(\**kwargs)
-------------------- --------------------
Just like ``get_list()``, except it returns a list of dictionaries instead of Just like ``get_list()``, except it returns a list of dictionaries instead of
@ -104,13 +104,13 @@ Use ``get_values()`` when you know you're only going to need a couple of field
values and you won't need the functionality of a model instance object. It's values and you won't need the functionality of a model instance object. It's
more efficient to select only the fields you need to use. more efficient to select only the fields you need to use.
get_values_iterator(**kwargs) get_values_iterator(\**kwargs)
----------------------------- -----------------------------
Just like ``get_values()``, except it returns an iterator instead of a list. Just like ``get_values()``, except it returns an iterator instead of a list.
See the section on ``get_iterator()`` above. See the section on ``get_iterator()`` above.
get_in_bulk(id_list, **kwargs) get_in_bulk(id_list, \**kwargs)
------------------------------ ------------------------------
Takes a list of IDs and returns a dictionary mapping each ID to an instance of Takes a list of IDs and returns a dictionary mapping each ID to an instance of
@ -499,7 +499,7 @@ following model::
>>> p.get_gender_display() >>> p.get_gender_display()
'Male' 'Male'
get_next_by_FOO(**kwargs) and get_previous_by_FOO(**kwargs) get_next_by_FOO(\**kwargs) and get_previous_by_FOO(\**kwargs)
----------------------------------------------------------- -----------------------------------------------------------
For every ``DateField`` and ``DateTimeField`` that does not have ``null=True``, For every ``DateField`` and ``DateTimeField`` that does not have ``null=True``,
@ -558,7 +558,7 @@ Extra module functions
In addition to every function described in "Basic lookup functions" above, a In addition to every function described in "Basic lookup functions" above, a
model module might get any or all of the following methods: model module might get any or all of the following methods:
get_FOO_list(kind, **kwargs) get_FOO_list(kind, \**kwargs)
---------------------------- ----------------------------
For every ``DateField`` and ``DateTimeField``, the model module will have a For every ``DateField`` and ``DateTimeField``, the model module will have a