diff options
| author | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-06-04 16:12:35 +0000 |
|---|---|---|
| committer | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-06-04 16:12:35 +0000 |
| commit | fe8c54a62a43b08b10ba343603d2b80e54d320b9 (patch) | |
| tree | 625342d42b88fe4a20d11e80a38dfaf1b261a0f2 /docs | |
| parent | 4365d6d086efaf8e8fe2a060be869c3313a356b5 (diff) | |
boulder-oracle-sprint: Merged to [5421]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5422 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/django-admin.txt | 9 | ||||
| -rw-r--r-- | docs/generic_views.txt | 3 | ||||
| -rw-r--r-- | docs/serialization.txt | 23 | ||||
| -rw-r--r-- | docs/settings.txt | 2 | ||||
| -rw-r--r-- | docs/templates_python.txt | 4 | ||||
| -rw-r--r-- | docs/testing.txt | 12 | ||||
| -rw-r--r-- | docs/tutorial04.txt | 5 | ||||
| -rw-r--r-- | docs/url_dispatch.txt | 9 |
8 files changed, 47 insertions, 20 deletions
diff --git a/docs/django-admin.txt b/docs/django-admin.txt index cc2eadc365..d20db7edc9 100644 --- a/docs/django-admin.txt +++ b/docs/django-admin.txt @@ -295,7 +295,7 @@ Serving static files with the development server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default, the development server doesn't serve any static files for your site -(such as CSS files, images, things under ``MEDIA_ROOT_URL`` and so forth). If +(such as CSS files, images, things under ``MEDIA_URL`` and so forth). If you want to configure Django to serve static media, read the `serving static files`_ documentation. @@ -403,9 +403,10 @@ this command to install the default apps. If you're installing the ``django.contrib.auth`` application, ``syncdb`` will give you the option of creating a superuser immediately. -``syncdb`` will also search for and install any fixture named ``initial_data``. -See the documentation for ``loaddata`` for details on the specification of -fixture data files. +``syncdb`` will also search for and install any fixture named ``initial_data`` +with an appropriate extension (e.g. ``json`` or ``xml``). See the +documentation for ``loaddata`` for details on the specification of fixture +data files. test ---- diff --git a/docs/generic_views.txt b/docs/generic_views.txt index bb5f7320f6..359a82506a 100644 --- a/docs/generic_views.txt +++ b/docs/generic_views.txt @@ -99,6 +99,9 @@ which is a dictionary of the parameters captured in the URL. dictionary is callable, the generic view will call it just before rendering the template. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_CONTENT_TYPE`` setting. + **Example:** Given the following URL patterns:: diff --git a/docs/serialization.txt b/docs/serialization.txt index 3216cb061e..01afa2708c 100644 --- a/docs/serialization.txt +++ b/docs/serialization.txt @@ -44,6 +44,25 @@ This is useful if you want to serialize data directly to a file-like object .. _HTTPResponse: ../request_response/#httpresponse-objects +Subset of fields +~~~~~~~~~~~~~~~~ + +If you only want a subset of fields to be serialized, you can +specify a `fields` argument to the serializer:: + + from django.core import serializers + data = serializers.serialize('xml', SomeModel.objects.all(), fields=('name','size')) + +In this example, only the `name` and `size` attributes of each model will +be serialized. + +.. note:: + + Depending on your model, you may find that it is not possible to deserialize + a model that only serializes a subset of its fields. If a serialized object + doesn't specify all the fields that are required by a model, the deserializer + will not be able to save deserialized instances. + Deserializing data ------------------ @@ -92,10 +111,14 @@ Django "ships" with a few included serializers: ``python`` Translates to and from "simple" Python objects (lists, dicts, strings, etc.). Not really all that useful on its own, but used as a base for other serializers. + + ``yaml`` Serializes to YAML (Yet Another Markup Lanuage). This + serializer is only available if PyYAML_ is installed. ========== ============================================================== .. _json: http://json.org/ .. _simplejson: http://undefined.org/python/#simplejson +.. _PyYAML: http://www.pyyaml.org/ Notes for specific serialization formats ---------------------------------------- diff --git a/docs/settings.txt b/docs/settings.txt index f30de3b981..5eb7904925 100644 --- a/docs/settings.txt +++ b/docs/settings.txt @@ -850,7 +850,7 @@ TEST_DATABASE_COLLATION Default: ``None`` The collation order to use when creating the test database. This value is -passed directly to the backend, so it's format is backend-specific. +passed directly to the backend, so its format is backend-specific. Only supported for ``mysql`` and ``mysql_old`` backends (see `section 10.3.2`_ of the MySQL manual for details). diff --git a/docs/templates_python.txt b/docs/templates_python.txt index aaf109b659..f3e2f2c64b 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -394,8 +394,8 @@ See the `internationalization docs`_ for more. django.core.context_processors.media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processors, every -``RequestContext`` will contain ``MEDIA_URL``, providing the +If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every +``RequestContext`` will contain a variable ``MEDIA_URL``, providing the value of the `MEDIA_URL setting`_. .. _MEDIA_URL setting: ../settings/#media-url diff --git a/docs/testing.txt b/docs/testing.txt index dedb1e15a8..50c4ec3046 100644 --- a/docs/testing.txt +++ b/docs/testing.txt @@ -571,13 +571,11 @@ database settings will the same as they would be for the project normally. If you wish to use a name other than the default for the test database, you can use the ``TEST_DATABASE_NAME`` setting to provide a name. - -**New in Django development version:** If you wish to have fine-grained -control over the character set encoding used in your database, you can control -this with the ``TEST_DATABASE_CHARSET`` setting. For MySQL users, you can also -control the particular collation used by the test database with the -``TEST_DATABASE_COLLATION`` setting. Refer to the settings_ documentation for -details of these advanced settings. +**New in Django development version:** For fine-grained control over the +character encoding of your database, use the ``TEST_DATABASE_CHARSET`` setting. +If you're using MySQL, you can also use the ``TEST_DATABASE_COLLATION`` setting +to control the particular collation used by the test database. See the +settings_ documentation for details of these advanced settings. .. _settings: ../settings/ diff --git a/docs/tutorial04.txt b/docs/tutorial04.txt index 8aa9379c91..5cc12c445d 100644 --- a/docs/tutorial04.txt +++ b/docs/tutorial04.txt @@ -67,7 +67,7 @@ So let's create a ``vote()`` function in ``mysite/polls/views.py``:: # Always return an HttpResponseRedirect after successfully dealing # with POST data. This prevents data from being posted twice if a # user hits the Back button. - return HttpResponseRedirect(reverse('results', args=(p.id,))) + return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(p.id,))) This code includes a few things we haven't covered yet in this tutorial: @@ -104,7 +104,8 @@ This code includes a few things we haven't covered yet in this tutorial: '/polls/3/results/' ... where the ``3`` is the value of ``p.id``. This redirected URL will - then call the ``'results'`` view to display the final page. + then call the ``'results'`` view to display the final page. Note that + you need to use the full name of the view here (including the prefix). For more information about ``reverse()``, see the `URL dispatcher`_ documentation. diff --git a/docs/url_dispatch.txt b/docs/url_dispatch.txt index 1a2efe605a..402b1200b5 100644 --- a/docs/url_dispatch.txt +++ b/docs/url_dispatch.txt @@ -564,10 +564,11 @@ code, Django provides the ``django.core.urlresolvers.reverse()``. The reverse(viewname, urlconf=None, args=None, kwargs=None) -The view name is either the function name or the `URL pattern name`_. -Normally you will not need to worry about the ``urlconf`` parameter and will -only pass in the positional and keyword arguments to use in the url matching. -For example:: +``viewname`` is either the function name (either a function reference, or the +string version of the name, if you used that form in ``urlpatterns``) or the +`URL pattern name`_. Normally, you won't need to worry about the +``urlconf`` parameter and will only pass in the positional and keyword +arguments to use in the URL matching. For example:: from django.core.urlresolvers import reverse |
