summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-01-28 15:35:46 +0000
committerJustin Bronn <jbronn@gmail.com>2008-01-28 15:35:46 +0000
commit00292ad02ebf9ff1cb09d586c2452b3a716fd601 (patch)
tree2ffd3546659f49b2eed2626ab5cfdf508ba69fbf /docs
parent398eca3fb2ac84304b179fabd2f0960228c59b09 (diff)
gis: Merged revisions 6990-7043 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/design_philosophies.txt2
-rw-r--r--docs/distributions.txt20
-rw-r--r--docs/localflavor.txt2
-rw-r--r--docs/modelforms.txt17
-rw-r--r--docs/shortcuts.txt4
-rw-r--r--docs/templates.txt9
-rw-r--r--docs/templates_python.txt6
7 files changed, 38 insertions, 22 deletions
diff --git a/docs/design_philosophies.txt b/docs/design_philosophies.txt
index 72aa8ade95..aae0fa836e 100644
--- a/docs/design_philosophies.txt
+++ b/docs/design_philosophies.txt
@@ -57,7 +57,7 @@ worth using only if it creates a huge convenience unattainable in other ways,
and it isn't implemented in a way that confuses developers who are trying to
learn how to use the feature.
-.. _`core Python principle`: http://www.python.org/doc/Humor.html#zen
+.. _`core Python principle`: http://www.python.org/dev/peps/pep-0020/
Consistency
-----------
diff --git a/docs/distributions.txt b/docs/distributions.txt
index d65e047276..48c30c7068 100644
--- a/docs/distributions.txt
+++ b/docs/distributions.txt
@@ -18,9 +18,9 @@ repository.
FreeBSD
=======
-The `FreeBSD`_ ports system offers both Django 0.96 (`py-django`_) and a more
-recent, but not current, version based on Django's trunk (`py-django-devel`_).
-These are installed in the normal FreeBSD way; for Django 0.96, for example, type:
+The `FreeBSD`_ ports system offers both Django 0.96 (`py-django`_) and a more
+recent, but not current, version based on Django's trunk (`py-django-devel`_).
+These are installed in the normal FreeBSD way; for Django 0.96, for example, type:
``cd /usr/ports/www/py-django && sudo make install clean``.
.. _FreeBSD: http://www.freebsd.org/
@@ -60,22 +60,22 @@ point to find their preferred version.
Gentoo
------
-A Django build is available for `Gentoo Linux`_, and is based on Django 0.96.
-The `current Gentoo build`_ can be installed by typing ``emerge django``.
+A Django package is available for `Gentoo Linux`_, and is based on Django 0.96.1.
+The `current Gentoo package`_ can be installed by typing ``emerge django``.
.. _Gentoo Linux: http://www.gentoo.org/
-.. _current Gentoo build: http://packages.gentoo.org/packages/?category=dev-python;name=django
+.. _current Gentoo package: http://packages.gentoo.org/package/django
Ubuntu
------
The Debian ``python-django`` package is also available for `Ubuntu Linux`_, in
-the "universe" repository for Ubuntu 7.04 ("Feisty Fawn"). The `current Ubuntu
-package`_ is also based on Django 0.95.1 and can be installed in the same
-fashion as for Debian.
+the "universe" repository for Ubuntu 7.10 ("Gutsy Gibbon"). The `current Ubuntu
+package`_ is based on Django 0.96.1 and can be installed in the same fashion as
+for Debian.
.. _Ubuntu Linux: http://www.ubuntu.com/
-.. _current Ubuntu package: http://packages.ubuntu.com/feisty/python/python-django
+.. _current Ubuntu package: http://packages.ubuntu.com/gutsy/python/python-django
Mac OS X
diff --git a/docs/localflavor.txt b/docs/localflavor.txt
index fc227fee28..75ec95382e 100644
--- a/docs/localflavor.txt
+++ b/docs/localflavor.txt
@@ -100,6 +100,8 @@ any code you'd like to contribute. One thing we ask is that you please use
Unicode objects (``u'mystring'``) for strings, rather than setting the encoding
in the file. See any of the existing flavors for examples.
+.. _create a ticket: http://code.djangoproject.com/simpleticket
+
Argentina (``django.contrib.localflavor.ar``)
=============================================
diff --git a/docs/modelforms.txt b/docs/modelforms.txt
index 0136540bed..a99e27fff7 100644
--- a/docs/modelforms.txt
+++ b/docs/modelforms.txt
@@ -17,7 +17,7 @@ class from a Django model.
For example::
>>> from django.newforms import ModelForm
-
+
# Create the form class.
>>> class ArticleForm(ModelForm):
... class Meta:
@@ -113,7 +113,7 @@ In addition, each generated form field has attributes set as follows:
``default`` value will be initially selected instead).
Finally, note that you can override the form field used for a given model
-field. See "Overriding the default field types" below.
+field. See `Overriding the default field types`_ below.
A full example
--------------
@@ -278,7 +278,7 @@ model fields:
To avoid this failure, you must instantiate your model with initial values
for the missing, but required fields, or use ``save(commit=False)`` and
manually set any extra required fields::
-
+
instance = Instance(required_field='value')
form = InstanceForm(request.POST, instance=instance)
new_instance = form.save()
@@ -295,7 +295,7 @@ model fields:
Overriding the default field types
----------------------------------
-The default field types, as described in the "Field types" table above, are
+The default field types, as described in the `Field types`_ table above, are
sensible defaults. If you have a ``DateField`` in your model, chances are you'd
want that to be represented as a ``DateField`` in your form. But
``ModelForm`` gives you the flexibility of changing the form field type
@@ -311,3 +311,12 @@ field, you could do the following::
...
... class Meta:
... model = Article
+
+If you want to override a field's default widget, then specify the ``widget``
+parameter when declaring the form field::
+
+ >>> class ArticleForm(ModelForm):
+ ... pub_date = DateField(widget=MyDateWidget())
+ ...
+ ... class Meta:
+ ... model = Article
diff --git a/docs/shortcuts.txt b/docs/shortcuts.txt
index f94babfecb..19eac4be6d 100644
--- a/docs/shortcuts.txt
+++ b/docs/shortcuts.txt
@@ -94,7 +94,7 @@ This example is equivalent to::
def my_view(request):
try:
- my_object = MyModel.object.get(pk=1)
+ my_object = MyModel.objects.get(pk=1)
except MyModel.DoesNotExist:
raise Http404
@@ -136,7 +136,7 @@ This example is equivalent to::
from django.http import Http404
def my_view(request):
- my_objects = MyModels.object.filter(published=True)
+ my_objects = MyModel.objects.filter(published=True)
if not my_objects:
raise Http404
diff --git a/docs/templates.txt b/docs/templates.txt
index ffda321512..c351c951c9 100644
--- a/docs/templates.txt
+++ b/docs/templates.txt
@@ -953,7 +953,7 @@ Available format strings:
U Not implemented.
w Day of the week, digits without ``'0'`` (Sunday) to ``'6'`` (Saturday)
leading zeros.
- W ISO-8601 week number of year, with ``1``, ``23``
+ W ISO-8601 week number of year, with ``1``, ``53``
weeks starting on Monday.
y Year, 2 digits. ``'99'``
Y Year, 4 digits. ``'1999'``
@@ -1230,7 +1230,7 @@ addslashes
Adds slashes before quotes. Useful for escaping strings in CSV, for example.
**New in Django development version**: for escaping data in JavaScript strings,
-use the `escapejs` filter instead.
+use the `escapejs`_ filter instead.
capfirst
~~~~~~~~
@@ -1403,6 +1403,11 @@ join
Joins a list with a string, like Python's ``str.join(list)``.
+last
+~~~~
+
+Returns the last item in a list.
+
length
~~~~~~
diff --git a/docs/templates_python.txt b/docs/templates_python.txt
index 014a853a41..f98cfa3249 100644
--- a/docs/templates_python.txt
+++ b/docs/templates_python.txt
@@ -823,11 +823,11 @@ Template filter code falls into one of two situations:
can operate in templates where auto-escaping is either on or off in
order to make things easier for your template authors.
- In order for you filter to know the current auto-escaping state, set the
- ``needs_autoescape`` attribute to ``True`` on your function. (If you
+ In order for your filter to know the current auto-escaping state, set
+ the ``needs_autoescape`` attribute to ``True`` on your function. (If you
don't specify this attribute, it defaults to ``False``). This attribute
tells Django that your filter function wants to be passed an extra
- keyword argument, called ``autoescape``, that is ``True`` is
+ keyword argument, called ``autoescape``, that is ``True`` if
auto-escaping is in effect and ``False`` otherwise.
For example, let's write a filter that emphasizes the first character of