summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-06-19 16:04:52 +0000
committerBrian Rosner <brosner@gmail.com>2008-06-19 16:04:52 +0000
commitd5899f17e920420c183e7379a6405033064ec785 (patch)
tree170ac0f15a1d270c2783b1db537d200a9ab786cc /docs
parent308cef40680050f2617400bb729a9e9a1fc0835a (diff)
newforms-admin: Merged from trunk up to [7706].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/django-admin.txt11
-rw-r--r--docs/form_preview.txt6
-rw-r--r--docs/model-api.txt30
-rw-r--r--docs/newforms.txt14
-rw-r--r--docs/settings.txt14
-rw-r--r--docs/templates.txt2
6 files changed, 69 insertions, 8 deletions
diff --git a/docs/django-admin.txt b/docs/django-admin.txt
index 8797d2e988..309166fe94 100644
--- a/docs/django-admin.txt
+++ b/docs/django-admin.txt
@@ -756,6 +756,17 @@ variable.
Note that this option is unnecessary in ``manage.py``, because it uses
``settings.py`` from the current project by default.
+--traceback
+-----------
+
+Example usage::
+
+ django-admin.py syncdb --traceback
+
+By default, ``django-admin.py`` will show a simple error message whenever an
+error occurs. If you specify ``--traceback``, ``django-admin.py`` will
+output a full stack trace whenever an exception is raised.
+
Extra niceties
==============
diff --git a/docs/form_preview.txt b/docs/form_preview.txt
index e6f9b05f25..e03de36187 100644
--- a/docs/form_preview.txt
+++ b/docs/form_preview.txt
@@ -69,12 +69,10 @@ How to use ``FormPreview``
...and add the following line to the appropriate model in your URLconf::
- (r'^post/$', SomeModelFormPreview(forms.models.form_for_model(SomeModel))),
-
- Or, if you already have a Form class defined for the model::
-
(r'^post/$', SomeModelFormPreview(SomeModelForm)),
+ where ``SomeModelForm`` is a Form or ModelForm class for the model.
+
4. Run the Django server and visit ``/post/`` in your browser.
.. _template loader docs: ../templates_python/#loader-types
diff --git a/docs/model-api.txt b/docs/model-api.txt
index d459b8638b..314c8ea4b5 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -1527,6 +1527,36 @@ In this way, you're tying the model's absolute URL to the view that is used
to display it, without repeating the URL information anywhere. You can still
use the ``get_absolute_url`` method in templates, as before.
+In some cases, such as the use of generic views or the re-use of
+custom views for multiple models, specifying the view function may
+confuse the reverse URL matcher (because multiple patterns point to
+the same view).
+
+For that problem, Django has **named URL patterns**. Using a named
+URL pattern, it's possible to give a name to a pattern, and then
+reference the name rather than the view function. A named URL
+pattern is defined by replacing the pattern tuple by a call to
+the ``url`` function)::
+
+ from django.conf.urls.defaults import *
+
+ url(r'^people/(\d+)/$',
+ 'django.views.generic.list_detail.object_detail',
+ name='people_view'),
+
+and then using that name to perform the reverse URL resolution instead
+of the view name::
+
+ from django.db.models import permalink
+
+ def get_absolute_url(self):
+ return ('people_view', [str(self.id)])
+ get_absolute_url = permalink(get_absolute_url)
+
+More details on named URL patterns can be found in `URL dispatch documentation`_.
+
+.. _URL dispatch documentation: ../url_dispatch/#naming-url-patterns
+
Executing custom SQL
--------------------
diff --git a/docs/newforms.txt b/docs/newforms.txt
index f81fcfc8dc..8386c0507c 100644
--- a/docs/newforms.txt
+++ b/docs/newforms.txt
@@ -1385,6 +1385,20 @@ extra arguments:
as choices.
============== ========== ===============================================
+``FloatField``
+~~~~~~~~~~~~~~
+
+ * Default widget: ``TextInput``
+ * Empty value: ``None``
+ * Normalizes to: A Python float.
+ * Validates that the given value is an float. Leading and trailing
+ whitespace is allowed, as in Python's ``float()`` function.
+ * Error message keys: ``required``, ``invalid``, ``max_value``,
+ ``min_value``
+
+Takes two optional arguments for validation, ``max_value`` and ``min_value``.
+These control the range of values permitted in the field.
+
``ImageField``
~~~~~~~~~~~~~~
diff --git a/docs/settings.txt b/docs/settings.txt
index 02e458fcda..3fe999d0d2 100644
--- a/docs/settings.txt
+++ b/docs/settings.txt
@@ -388,8 +388,13 @@ be able to give backtraces without seeing sensitive (or offensive) settings.
Still, note that there are always going to be sections of your debug output that
are inappropriate for public consumption. File paths, configuration options, and
-the like all give attackers extra information about your server. Never deploy a
-site with ``DEBUG`` turned on.
+the like all give attackers extra information about your server.
+
+It is also important to remember that when running with ``DEBUG`` turned on, Django
+will remember every SQL query it executes. This is useful when you are debugging,
+but on a production server, it will rapidly consume memory.
+
+Never deploy a site into production with ``DEBUG`` turned on.
DEBUG_PROPAGATE_EXCEPTIONS
--------------------------
@@ -958,7 +963,10 @@ See the `template documentation`_.
TEMPLATE_LOADERS
----------------
-Default: ``('django.template.loaders.filesystem.load_template_source',)``
+Default::
+
+ ('django.template.loaders.filesystem.load_template_source',
+ 'django.template.loaders.app_directories.load_template_source')
A tuple of callables (as strings) that know how to import templates from
various sources. See the `template documentation`_.
diff --git a/docs/templates.txt b/docs/templates.txt
index 3b2c03766b..3a557c1476 100644
--- a/docs/templates.txt
+++ b/docs/templates.txt
@@ -346,7 +346,7 @@ To avoid this problem, you have two options:
* One, you can make sure to run each untrusted variable through the
``escape`` filter (documented below), which converts potentially harmful
- HTML characters to unharmful ones. This was default the default solution
+ HTML characters to unharmful ones. This was the default solution
in Django for its first few years, but the problem is that it puts the
onus on *you*, the developer / template author, to ensure you're escaping
everything. It's easy to forget to escape data.