summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-11 20:24:45 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-11 20:24:45 +0000
commitd442731eb2af671d93550426cf061713a50468d2 (patch)
tree6d2242897331a0037764a9b44349b1922e6772d0 /docs
parentd79cfec906daf449c0fa22bb9a8d3dd205567fde (diff)
i18n: merged r815:r843 from trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/db-api.txt5
-rw-r--r--docs/generic_views.txt12
-rw-r--r--docs/model-api.txt22
3 files changed, 22 insertions, 17 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt
index 8a02437aaa..b80d4e8647 100644
--- a/docs/db-api.txt
+++ b/docs/db-api.txt
@@ -449,8 +449,7 @@ Related objects (e.g. ``Choices``) are created using convenience functions::
>>> p.get_choice_count()
4
-Each of those ``add_choice`` methods is equivalent to (except obviously much
-simpler than)::
+Each of those ``add_choice`` methods is equivalent to (but much simpler than)::
>>> c = polls.Choice(poll_id=p.id, choice="Over easy", votes=0)
>>> c.save()
@@ -459,6 +458,8 @@ Note that when using the `add_foo()`` methods, you do not give any value
for the ``id`` field, nor do you give a value for the field that stores
the relation (``poll_id`` in this case).
+The ``add_FOO()`` method always returns the newly created object.
+
Deleting objects
================
diff --git a/docs/generic_views.txt b/docs/generic_views.txt
index 62e7c14e2b..1c0de07a7a 100644
--- a/docs/generic_views.txt
+++ b/docs/generic_views.txt
@@ -115,7 +115,7 @@ The date-based generic functions are:
Yearly archive. Requires that the ``year`` argument be present in the URL
pattern.
- Uses the template ``app_label/module_name__archive_year`` by default.
+ Uses the template ``app_label/module_name_archive_year`` by default.
Has the following template context:
@@ -134,7 +134,7 @@ The date-based generic functions are:
default, which is a three-letter month abbreviation. To change it to use
numbers, use ``"%m"``.
- Uses the template ``app_label/module_name__archive_month`` by default.
+ Uses the template ``app_label/module_name_archive_month`` by default.
Has the following template context:
@@ -151,7 +151,7 @@ The date-based generic functions are:
also pass ``day_format``, which defaults to ``"%d"`` (day of the month as a
decimal number, 1-31).
- Uses the template ``app_label/module_name__archive_day`` by default.
+ Uses the template ``app_label/module_name_archive_day`` by default.
Has the following template context:
@@ -246,6 +246,8 @@ Individual views are:
The previous page
``pages``
Number of pages total
+ ``hits``
+ Total number of objects
``object_detail``
Object detail page. This works like and takes the same arguments as
@@ -272,7 +274,7 @@ The create/update/delete views are:
be interpolated against the object's field attributes. For example, you
could use ``post_save_redirect="/polls/%(slug)s/"``.
- Uses the template ``app_label/module_name__form`` by default. This is the
+ Uses the template ``app_label/module_name_form`` by default. This is the
same template as the ``update_object`` view below. Your template can tell
the different by the presence or absence of ``{{ object }}`` in the
context.
@@ -294,7 +296,7 @@ The create/update/delete views are:
``list_detail.object_detail`` does (see above), and the same
``post_save_redirect`` as ``create_object`` does.
- Uses the template ``app_label/module_name__form`` by default.
+ Uses the template ``app_label/module_name_form`` by default.
Has the following template context:
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 4af193ca48..2ad2b3594d 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -95,8 +95,8 @@ The following arguments are available to all field types. All are optional.
('GR', 'Graduate'),
)
- The first element in each tuple is the actual value to be stored. The
- second element is the human-readable name for the option.
+ The first element in each tuple is the actual value to be stored. The
+ second element is the human-readable name for the option.
``core``
For objects that are edited inline to a related object.
@@ -248,18 +248,18 @@ Here are all available field types:
uploaded files don't fill up the given directory).
The admin represents this as an ``<input type="file">`` (a file-upload widget).
-
- Using a `FieldField` or an ``ImageField`` (see below) in a model takes a few
+
+ Using a `FieldField` or an ``ImageField`` (see below) in a model takes a few
steps:
-
+
1. In your settings file, you'll need to define ``MEDIA_ROOT``as the
full path to a directory where you'd like Django to store uploaded
files. (For performance, these files are not stored in the database.)
Define ``MEDIA_URL`` as the base public URL of that directory. Make
sure that this directory is writable by the Web server's user
account.
-
- 2. Add the ``FileField`` or ``ImageField`` to your model, making sure
+
+ 2. Add the ``FileField`` or ``ImageField`` to your model, making sure
to define the ``upload_to`` option to tell Django to which
subdirectory of ``MEDIA_ROOT`` it should upload files.
@@ -269,7 +269,7 @@ Here are all available field types:
example, if your ``ImageField`` is called ``mug_shot``, you can get
the absolute URL to your image in a template with ``{{
object.get_mug_shot_url }}``.
-
+
.. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941
``FloatField``
@@ -302,7 +302,7 @@ Here are all available field types:
width of the image each time a model instance is saved.
Requires the `Python Imaging Library`_.
-
+
.. _Python Imaging Library: http://www.pythonware.com/products/pil/
``IntegerField``
@@ -721,7 +721,9 @@ Here's a list of all possible ``META`` options. No options are required. Adding
unique_together = (("driver", "restaurant"),)
This is a list of lists of fields that must be unique when considered
- together. It's used in the Django admin.
+ together. It's used in the Django admin and is enforced at the database
+ level (i.e., the appropriate ``UNIQUE`` statements are included in the
+ ``CREATE TABLE`` statement).
``verbose_name``
A human-readable name for the object, singular::