A whole lotta documentation fixes: Fixes #8704, #8826, #8980, #9243, #9343, #9529,

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2009-03-31 23:34:03 +00:00
parent 15becf23a9
commit 516051bfd2
24 changed files with 206 additions and 48 deletions

View file

@ -832,8 +832,17 @@ It is important you use a ``ModelForm`` here otherwise things can break. See the
============================
The admin interface has the ability to edit models on the same page as a
parent model. These are called inlines. You can add them to a model by
specifying them in a ``ModelAdmin.inlines`` attribute::
parent model. These are called inlines. Suppose you have these two models::
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
author = models.ForeignKey(Author)
title = models.CharField(max_length=100)
You can edit the books authored by an author on the author page. You add
inlines to a model by specifying them in a ``ModelAdmin.inlines``::
class BookInline(admin.TabularInline):
model = Book
@ -1165,7 +1174,7 @@ Hooking ``AdminSite`` instances into your URLconf
The last step in setting up the Django admin is to hook your ``AdminSite``
instance into your URLconf. Do this by pointing a given URL at the
``AdminSite.root`` method.
``AdminSite.urls`` method.
In this example, we register the default ``AdminSite`` instance
``django.contrib.admin.site`` at the URL ``/admin/`` ::

View file

@ -155,9 +155,10 @@ A complete form might look like::
{% get_comment_form for event as form %}
<form action="{% comment_form_target %}" method="POST">
{{ form }}
<p class="submit">
<input type="submit" name="preview" class="submit-post" value="Preview">
</p>
<tr>
<td></td>
<td><input type="submit" name="preview" class="submit-post" value="Preview"></td>
</tr>
</form>
Be sure to read the `notes on the comment form`_, below, for some special

View file

@ -324,6 +324,14 @@ same types of lookups manually::
... object_id=b.id)
[<TaggedItem: django>, <TaggedItem: python>]
Note that if the model with a :class:`~django.contrib.contenttypes.generic.GenericForeignKey`
that you're referring to uses a non-default value for ``ct_field`` or ``fk_field``
(e.g. the :mod:`django.contrib.comments` app uses ``ct_field="object_pk"``),
you'll need to pass ``content_type_field`` and ``object_id_field`` to
:class:`~django.contrib.contenttypes.generic.GenericRelation`.::
comments = generic.GenericRelation(Comment, content_type_field="content_type", object_id_field="object_pk")
Note that if you delete an object that has a
:class:`~django.contrib.contenttypes.generic.GenericRelation`, any objects
which have a :class:`~django.contrib.contenttypes.generic.GenericForeignKey`

View file

@ -290,7 +290,7 @@ Advanced FormWizard methods
.. method:: FormWizard.render_template
Renders the template for the given step, returning an
:class:`~django.http.HttpResponseRedirect` object.
:class:`~django.http.HttpResponse` object.
Override this method if you want to add a custom context, return a different
MIME type, etc. If you only need to override the template name, use