Fixed a whole bunch of small docs typos, errors, and ommissions.

Fixes #8358, #8396, #8724, #9043, #9128, #9247, #9267, #9267, #9375, #9409, #9414, #9416, #9446, #9454, #9464, #9503, #9518, #9533, #9657, #9658, #9683, #9733, #9771, #9835, #9836, #9837, #9897, #9906, #9912, #9945, #9986, #9992, #10055, #10084, #10091, #10145, #10245, #10257, #10309, #10358, #10359, #10424, #10426, #10508, #10531, #10551, #10635, #10637, #10656, #10658, #10690, #10699, #19528.

Thanks to all the respective authors of those tickets.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2009-04-03 18:30:54 +00:00
parent d2a8bc5b40
commit c6c25adf6d
50 changed files with 551 additions and 262 deletions

View file

@ -46,6 +46,11 @@ Other topics
:maxdepth: 1
actions
.. seealso::
For information about serving the media files (images, JavaScript, and CSS)
associated with the admin in production, see :ref:`serving-media-files`.
``ModelAdmin`` objects
======================
@ -425,8 +430,8 @@ edit and save multiple rows at once.
``list_editable`` interacts with a couple of other options in particular
ways; you should note the following rules:
* To use ``list_editable`` you must have defined ``ordering`` on
either your model or your ``ModelAdmin``.
* To use ``list_editable`` you must have defined ``ordering`` on either
your model's or your ``ModelAdmin``'s inner ``Meta``.
* Any field in ``list_editable`` must also be in ``list_display``. You
can't edit a field that's not displayed!
@ -1155,6 +1160,37 @@ If you wish to change the index or login templates, you are better off creating
your own ``AdminSite`` instance (see below), and changing the ``index_template``
or ``login_template`` properties.
Linking to admin views
======================
.. versionadded:: 1.1
All the admin views use :ref:`named URL patterns <naming-url-patterns>` so it's
easy to link to admin views with ``urlresolvers.reverse`` or the :ttag:`url`
template tag.
Each model gets its own set of views and its own name using the model's app name
and model name. For example, the "add" view for a ``Choice`` model in a
``polls`` app would be named ``"admin_polls_choice_add"``.
All the available views and their names are:
============== ====================================== ===================
View View name Parameters
============== ====================================== ===================
Change list ``"admin_<app>_<model>_changelist"`` None
Add object ``"admin_<app>_<model>_add"`` None
Change object ``"admin_<app>_<model>_change"`` ``object_id``
Delete object ``"admin_<app>_<model>_delete"`` ``object_id``
Object history ``"admin_<app>_<model>_history"`` ``object_id``
============== ====================================== ===================
For example, to get the change URL for a particular ``Choice`` object::
>>> from django.core import urlresolvers
>>> c = Choice.objects.get(...)
>>> change_url = urlresolvers.reverse('admin_polls_choice_change', (c.id,))
``AdminSite`` objects
=====================

View file

@ -99,6 +99,10 @@ For example::
{% for comment in comment_list %}
...
{% endfor %}
This returns a list of :class:`~django.contrib.comments.models.Comment` objects;
see :ref:`the comment model documentation <ref-contrib-comments-models>` for
details.
.. templatetag:: get_comment_count
@ -212,6 +216,7 @@ More information
.. toctree::
:maxdepth: 1
models
settings
signals
upgrade

View file

@ -0,0 +1,82 @@
.. _ref-contrib-comments-models:
===========================
The built-in comment models
===========================
.. module:: django.contrib.comments.models
:synopsis: The built-in comment models
.. class:: Comment
Django's built-in comment model. Has the following fields:
.. attribute:: content_object
A :class:`~django.contrib.contettypes.generic.GenericForeignKey`
attribute pointing to the object the comment is attached to. You can use
this to get at the related object (i.e. ``my_comment.content_object``).
Since this field is a
:class:`~django.contrib.contettypes.generic.GenericForeignKey`, it's
actually syntactic sugar on top of two underlying attributes, described
below.
.. attribute:: content_type
A :class:`~django.db.models.ForeignKey` to
:class:`~django.contrib.contenttypes.models.ContentType`; this is the
type of the object the comment is attached to.
.. attribute:: object_pk
A :class:`~django.db.models.TextField` containing the primary
key of the object the comment is attached to.
.. attribute:: site
A :class:`~django.db.models.ForeignKey` to the
:class:`~django.contrib.sites.models.Site` on which the comment was
posted.
.. attribute:: user
A :class:`~django.db.models.ForeignKey` to the
:class:`~django.contrib.auth.models.User` who posted the comment.
May be blank if the comment was posted by an unauthenticated user.
.. attribute:: user_name
The name of the user who posted the comment.
.. attribute:: user_email
The email of the user who posteed the comment.
.. attribute:: user_url
The URL entered by the person who posted the comment.
.. attribute:: comment
The actual content of the comment itself.
.. attribute:: submit_date
The date the comment was submitted.
.. attribute:: ip_address
The IP address of the user posting the comment.
.. attribute:: is_public
``False`` if the comment is in moderation (see
:ref:`ref-contrib-comments-moderation`); If ``True``, the comment will
be displayed on the site.
.. attribute:: is_removed
``True`` if the comment was removed. Used to keep track of removed
comments instead of just deleting them.

View file

@ -39,6 +39,11 @@ To install the flatpages app, follow these steps:
``'django.contrib.sites'`` to your :setting:`INSTALLED_APPS` setting,
if it's not already in there.
Also make sure you've correctly set :setting:`SITE_ID` to the ID of the
site the settings file represents. This will usually be ``1`` (i.e.
``SITE_ID = 1``, but if you're not using the sites framework to manage
multiple sites, it could be the ID of a different site.
2. Add ``'django.contrib.flatpages'`` to your :setting:`INSTALLED_APPS`
setting.

View file

@ -160,11 +160,11 @@ into those elements.
:class:`~django.contrib.syndication.feeds.Feed` class.
* To specify the contents of ``<link>``, you have two options. For each item
in :meth:`items()`, Django first tries executing a ``get_absolute_url()``
method on that object. If that method doesn't exist, it tries calling a
method :meth:`item_link()` in the
:class:`~django.contrib.syndication.feeds.Feed` class, passing it a single
parameter, :attr:`item`, which is the object itself. Both
in :meth:`items()`, Django first tries calling a method
:meth:`item_link()` in the :class:`~django.contrib.syndication.feeds.Feed`
class, passing it a single parameter, :attr:`item`, which is the object
itself. If that method doesn't exist, Django tries executing a
``get_absolute_url()`` method on that object. . Both
``get_absolute_url()`` and :meth:`item_link()` should return the item's
URL as a normal Python string. As with ``get_absolute_url()``, the result
of :meth:`item_link()` will be included directly in the URL, so you are
@ -644,9 +644,8 @@ This example illustrates all possible attributes and methods for a
Returns the URL for every item in the feed.
"""
# ITEM_GUID -- The following method is optional. This property is
# only used for Atom feeds (it is the ID element for an item in an
# Atom feed). If not provided, the item's link is used by default.
# ITEM_GUID -- The following method is optional. If not provided, the
# item's link is used by default.
def item_guid(self, obj):
"""