Commit e47520b8 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

[1.2.X] Fixed #14112 -- Various Markup fixes for the docs. Thanks to ramiro for the patch.

Backport of r13628 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13629 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 0472978d
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -35,19 +35,22 @@ Set the :setting:`CACHE_MIDDLEWARE_ANONYMOUS_ONLY` setting to ``True``. See the
How do I automatically set a field's value to the user who last edited the object in the admin?
-----------------------------------------------------------------------------------------------

The :class:`ModelAdmin` class provides customization hooks that allow you to transform
an object as it saved, using details from the request. By extracting the current user
from the request, and customizing the :meth:`ModelAdmin.save_model` hook, you can update
an object to reflect the user that edited it. See :ref:`the documentation on ModelAdmin
methods <model-admin-methods>` for an example.
The :class:`~django.contrib.admin.ModelAdmin` class provides customization hooks
that allow you to transform an object as it saved, using details from the
request. By extracting the current user from the request, and customizing the
:meth:`~django.contrib.admin.ModelAdmin.save_model` hook, you can update an
object to reflect the user that edited it. See :ref:`the documentation on
ModelAdmin methods <model-admin-methods>` for an example.

How do I limit admin access so that objects can only be edited by the users who created them?
---------------------------------------------------------------------------------------------

The :class:`ModelAdmin` class also provides customization hooks that allow you to control the
visibility and editability of objects in the admin. Using the same trick of extracting the
user from the request, the :meth:`ModelAdmin.queryset` and :meth:`ModelAdmin.has_change_permission`
can be used to control the visibility and editability of objects in the admin.
The :class:`~django.contrib.admin.ModelAdmin` class also provides customization
hooks that allow you to control the visibility and editability of objects in the
admin. Using the same trick of extracting the user from the request, the
:meth:`~django.contrib.admin.ModelAdmin.queryset` and
:meth:`~django.contrib.admin.ModelAdmin.has_change_permission` can be used to
control the visibility and editability of objects in the admin.

My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python.
---------------------------------------------------------------------------------------------------------------------------
+3 −3
Original line number Diff line number Diff line
@@ -5,8 +5,6 @@ The Django admin site
.. module:: django.contrib.admin
   :synopsis: Django's admin site.

.. currentmodule:: django.contrib.admin

One of the most powerful parts of Django is the automatic admin interface. It
reads metadata in your model to provide a powerful and production-ready
interface that content producers can immediately use to start adding content to
@@ -1010,6 +1008,8 @@ information.
``InlineModelAdmin`` objects
============================

.. class:: InlineModelAdmin

The admin interface has the ability to edit models on the same page as a
parent model. These are called inlines. Suppose you have these two models::

+2 −2
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ Methods on ``ContentType`` instances

    Takes a set of valid :ref:`lookup arguments <field-lookups-intro>` for the
    model the :class:`~django.contrib.contenttypes.models.ContentType`
    represents, and does :ref:`a get() lookup <get-kwargs>` on that model,
    represents, and does :lookup:`a get() lookup <get>` on that model,
    returning the corresponding object.

.. method:: models.ContentType.model_class()
@@ -370,7 +370,7 @@ This enables the use of generic relations in forms and the admin. See the

    The :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin`
    class inherits all properties from an
    :class:`~django.contrib.admin.options.InlineModelAdmin` class. However,
    :class:`~django.contrib.admin.InlineModelAdmin` class. However,
    it adds a couple of its own for working with the generic relation:

    .. attribute:: generic.GenericInlineModelAdmin.ct_field
+4 −4
Original line number Diff line number Diff line
@@ -166,8 +166,8 @@ must be used. To use this runner, configure :setting:`TEST_RUNNER` as follows::

.. note::

    In order to create a spatial database, the :setting:`DATABASE_USER` setting
    (or :setting:`TEST_DATABASE_USER`, if optionally defined on Oracle) requires
    In order to create a spatial database, the :setting:`USER` setting
    (or :setting:`TEST_USER`, if optionally defined on Oracle) requires
    elevated privileges.  When using PostGIS or MySQL, the database user
    must have at least the ability to create databases.  When testing on Oracle,
    the user should be a superuser.
+3 −2
Original line number Diff line number Diff line
@@ -166,8 +166,9 @@ For more documentation, read the source code in
ReStructured Text
-----------------

When using the `restructuredtext` markup filter you can define a :setting:`RESTRUCTUREDTEXT_FORMAT_SETTINGS`
in your django settings to override the default writer settings. See the `restructuredtext writer settings`_ for
When using the ``restructuredtext`` markup filter you can define a
:setting:`RESTRUCTUREDTEXT_FILTER_SETTINGS` in your django settings to override
the default writer settings. See the `restructuredtext writer settings`_ for
details on what these settings are.

.. _restructuredtext writer settings: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer
Loading