diff --git a/docs/faq/admin.txt b/docs/faq/admin.txt
|
a
|
b
|
|
| 37 | 37 | How do I automatically set a field's value to the user who last edited the object in the admin? |
| 38 | 38 | ----------------------------------------------------------------------------------------------- |
| 39 | 39 | |
| 40 | | The :class:`ModelAdmin` class provides customization hooks that allow you to transform |
| 41 | | an object as it saved, using details from the request. By extracting the current user |
| 42 | | from the request, and customizing the :meth:`ModelAdmin.save_model` hook, you can update |
| 43 | | an object to reflect the user that edited it. See :ref:`the documentation on ModelAdmin |
| 44 | | methods <model-admin-methods>` for an example. |
| | 40 | The :class:`~django.contrib.admin.ModelAdmin` class provides customization hooks |
| | 41 | that allow you to transform an object as it saved, using details from the |
| | 42 | request. By extracting the current user from the request, and customizing the |
| | 43 | :meth:`~django.contrib.admin.ModelAdmin.save_model` hook, you can update an |
| | 44 | object to reflect the user that edited it. See :ref:`the documentation on |
| | 45 | ModelAdmin methods <model-admin-methods>` for an example. |
| 45 | 46 | |
| 46 | 47 | How do I limit admin access so that objects can only be edited by the users who created them? |
| 47 | 48 | --------------------------------------------------------------------------------------------- |
| 48 | 49 | |
| 49 | | The :class:`ModelAdmin` class also provides customization hooks that allow you to control the |
| 50 | | visibility and editability of objects in the admin. Using the same trick of extracting the |
| 51 | | user from the request, the :meth:`ModelAdmin.queryset` and :meth:`ModelAdmin.has_change_permission` |
| 52 | | can be used to control the visibility and editability of objects in the admin. |
| | 50 | The :class:`~django.contrib.admin.ModelAdmin` class also provides customization |
| | 51 | hooks that allow you to control the visibility and editability of objects in the |
| | 52 | admin. Using the same trick of extracting the user from the request, the |
| | 53 | :meth:`~django.contrib.admin.ModelAdmin.queryset` and |
| | 54 | :meth:`~django.contrib.admin.ModelAdmin.has_change_permission` can be used to |
| | 55 | control the visibility and editability of objects in the admin. |
| 53 | 56 | |
| 54 | 57 | My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python. |
| 55 | 58 | --------------------------------------------------------------------------------------------------------------------------- |
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
|
a
|
b
|
|
| 7 | 7 | .. module:: django.contrib.admin |
| 8 | 8 | :synopsis: Django's admin site. |
| 9 | 9 | |
| 10 | | .. currentmodule:: django.contrib.admin |
| 11 | | |
| 12 | 10 | One of the most powerful parts of Django is the automatic admin interface. It |
| 13 | 11 | reads metadata in your model to provide a powerful and production-ready |
| 14 | 12 | interface that content producers can immediately use to start adding content to |
| … |
… |
|
| 833 | 831 | |
| 834 | 832 | Since this is usually not what you want, Django provides a convenience wrapper |
| 835 | 833 | to check permissions and mark the view as non-cacheable. This wrapper is |
| 836 | | :meth:`AdminSite.admin_view` (i.e. ``self.admin_site.admin_view`` inside a |
| | 834 | :meth:`AdminSite.admin_view` (i.e. ``self.admin_site.admin_view`` inside a |
| 837 | 835 | ``ModelAdmin`` instance); use it like so:: |
| 838 | 836 | |
| 839 | 837 | class MyModelAdmin(admin.ModelAdmin): |
| … |
… |
|
| 1012 | 1010 | ``InlineModelAdmin`` objects |
| 1013 | 1011 | ============================ |
| 1014 | 1012 | |
| | 1013 | .. class:: InlineModelAdmin |
| | 1014 | |
| 1015 | 1015 | The admin interface has the ability to edit models on the same page as a |
| 1016 | 1016 | parent model. These are called inlines. Suppose you have these two models:: |
| 1017 | 1017 | |
diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt
|
a
|
b
|
|
| 114 | 114 | |
| 115 | 115 | Takes a set of valid :ref:`lookup arguments <field-lookups-intro>` for the |
| 116 | 116 | model the :class:`~django.contrib.contenttypes.models.ContentType` |
| 117 | | represents, and does :ref:`a get() lookup <get-kwargs>` on that model, |
| | 117 | represents, and does :lookup:`a get() lookup <get>` on that model, |
| 118 | 118 | returning the corresponding object. |
| 119 | 119 | |
| 120 | 120 | .. method:: models.ContentType.model_class() |
| … |
… |
|
| 372 | 372 | |
| 373 | 373 | The :class:`~django.contrib.contenttypes.generic.GenericInlineModelAdmin` |
| 374 | 374 | class inherits all properties from an |
| 375 | | :class:`~django.contrib.admin.options.InlineModelAdmin` class. However, |
| | 375 | :class:`~django.contrib.admin.InlineModelAdmin` class. However, |
| 376 | 376 | it adds a couple of its own for working with the generic relation: |
| 377 | 377 | |
| 378 | 378 | .. attribute:: generic.GenericInlineModelAdmin.ct_field |
diff --git a/docs/ref/contrib/gis/testing.txt b/docs/ref/contrib/gis/testing.txt
|
a
|
b
|
|
| 133 | 133 | If ``init_spatialite-2.3.sql`` is in the same path as your project's ``manage.py``, |
| 134 | 134 | then all you have to do is:: |
| 135 | 135 | |
| 136 | | $ python manage.py test |
| | 136 | $ python manage.py test |
| 137 | 137 | |
| 138 | 138 | Settings |
| 139 | 139 | -------- |
| … |
… |
|
| 166 | 166 | |
| 167 | 167 | .. note:: |
| 168 | 168 | |
| 169 | | In order to create a spatial database, the :setting:`DATABASE_USER` setting |
| 170 | | (or :setting:`TEST_DATABASE_USER`, if optionally defined on Oracle) requires |
| 171 | | elevated privileges. When using PostGIS or MySQL, the database user |
| | 169 | In order to create a spatial database, the :setting:`USER` setting |
| | 170 | (or :setting:`TEST_USER`, if optionally defined on Oracle) requires |
| | 171 | elevated privileges. When using PostGIS or MySQL, the database user |
| 172 | 172 | must have at least the ability to create databases. When testing on Oracle, |
| 173 | 173 | the user should be a superuser. |
| 174 | 174 | |
diff --git a/docs/ref/contrib/index.txt b/docs/ref/contrib/index.txt
|
a
|
b
|
|
| 168 | 168 | ReStructured Text |
| 169 | 169 | ----------------- |
| 170 | 170 | |
| 171 | | When using the `restructuredtext` markup filter you can define a :setting:`RESTRUCTUREDTEXT_FORMAT_SETTINGS` |
| 172 | | in your django settings to override the default writer settings. See the `restructuredtext writer settings`_ for |
| | 171 | When using the ``restructuredtext`` markup filter you can define a |
| | 172 | :setting:`RESTRUCTUREDTEXT_FILTER_SETTINGS` in your django settings to override |
| | 173 | the default writer settings. See the `restructuredtext writer settings`_ for |
| 173 | 174 | details on what these settings are. |
| 174 | 175 | |
| 175 | 176 | .. _restructuredtext writer settings: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer |
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
|
a
|
b
|
|
| 106 | 106 | Compiles .po files created with ``makemessages`` to .mo files for use with |
| 107 | 107 | the builtin gettext support. See :ref:`topics-i18n`. |
| 108 | 108 | |
| 109 | | Use the :djadminopt:`--locale`` option to specify the locale to process. |
| | 109 | Use the :djadminopt:`--locale` option to specify the locale to process. |
| 110 | 110 | If not provided, all locales are processed. |
| 111 | 111 | |
| 112 | 112 | Example usage:: |
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
|
a
|
b
|
|
| 293 | 293 | will automatically create it using the field's attribute name, converting |
| 294 | 294 | underscores to spaces. See :ref:`Verbose field names <verbose-field-names>`. |
| 295 | 295 | |
| 296 | | .. _model-field-types: |
| 297 | | |
| 298 | 296 | ``validators`` |
| 299 | 297 | ------------------- |
| 300 | 298 | |
| … |
… |
|
| 305 | 303 | A list of validators to run for this field.See the :ref:`validators |
| 306 | 304 | documentation <ref-validators>` for more information. |
| 307 | 305 | |
| | 306 | .. _model-field-types: |
| 308 | 307 | |
| 309 | 308 | Field types |
| 310 | 309 | =========== |
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
|
a
|
b
|
|
| 964 | 964 | These methods do not use a cache (see :ref:`caching-and-querysets`). Rather, |
| 965 | 965 | they query the database each time they're called. |
| 966 | 966 | |
| 967 | | .. _get-kwargs: |
| 968 | | |
| 969 | 967 | ``get(**kwargs)`` |
| 970 | 968 | ~~~~~~~~~~~~~~~~~ |
| 971 | 969 | |
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
|
a
|
b
|
|
| 132 | 132 | |
| 133 | 133 | The cache backend to use. See :ref:`topics-cache`. |
| 134 | 134 | |
| | 135 | .. setting:: CACHE_MIDDLEWARE_ANONYMOUS_ONLY |
| | 136 | |
| | 137 | CACHE_MIDDLEWARE_ANONYMOUS_ONLY |
| | 138 | ------------------------------- |
| | 139 | |
| | 140 | Default: ``False`` |
| | 141 | |
| | 142 | If the value of this setting is ``True``, only anonymous requests (i.e., not |
| | 143 | those made by a logged-in user) will be cached. Otherwise, the middleware |
| | 144 | caches every page that doesn't have GET or POST parameters. |
| | 145 | |
| | 146 | If you set the value of this setting to ``True``, you should make sure you've |
| | 147 | activated ``AuthenticationMiddleware``. |
| | 148 | |
| | 149 | See the :ref:`cache documentation <topics-cache>` for more information. |
| | 150 | |
| 135 | 151 | .. setting:: CACHE_MIDDLEWARE_KEY_PREFIX |
| 136 | 152 | |
| 137 | 153 | CACHE_MIDDLEWARE_KEY_PREFIX |
| … |
… |
|
| 387 | 403 | |
| 388 | 404 | See :ref:`topics-testing`. |
| 389 | 405 | |
| | 406 | .. setting:: TEST_USER |
| | 407 | |
| | 408 | TEST_USER |
| | 409 | ~~~~~~~~~ |
| | 410 | |
| | 411 | Default: ``None`` |
| | 412 | |
| | 413 | This is an Oracle-specific setting. |
| | 414 | |
| | 415 | The username to use when connecting to the Oracle database that will be used |
| | 416 | when running tests. |
| 390 | 417 | |
| 391 | 418 | .. setting:: DATABASE_ROUTERS |
| 392 | 419 | |
| … |
… |
|
| 555 | 582 | isn't manually specified. Used with ``DEFAULT_CHARSET`` to construct the |
| 556 | 583 | ``Content-Type`` header. |
| 557 | 584 | |
| 558 | | .. setting:: DEFAULT_FROM_EMAIL |
| | 585 | .. setting:: DEFAULT_FILE_STORAGE |
| 559 | 586 | |
| 560 | 587 | DEFAULT_FILE_STORAGE |
| 561 | 588 | -------------------- |
| … |
… |
|
| 565 | 592 | Default file storage class to be used for any file-related operations that don't |
| 566 | 593 | specify a particular storage system. See :ref:`topics-files`. |
| 567 | 594 | |
| | 595 | .. setting:: DEFAULT_FROM_EMAIL |
| | 596 | |
| 568 | 597 | DEFAULT_FROM_EMAIL |
| 569 | 598 | ------------------ |
| 570 | 599 | |
| … |
… |
|
| 1168 | 1197 | the default values, see the file `django/conf/global_settings.py`_. |
| 1169 | 1198 | |
| 1170 | 1199 | .. _django/conf/global_settings.py: http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py |
| | 1200 | |
| | 1201 | .. setting:: RESTRUCTUREDTEXT_FILTER_SETTINGS |
| | 1202 | |
| | 1203 | RESTRUCTUREDTEXT_FILTER_SETTINGS |
| | 1204 | -------------------------------- |
| | 1205 | |
| | 1206 | Default: ``{}`` |
| | 1207 | |
| | 1208 | A dictionary containing settings for the ``restructuredtext`` markup filter from |
| | 1209 | the :ref:`django.contrib.markup application <ref-contrib-markup>`. They override |
| | 1210 | the default writer settings. See the Docutils restructuredtext `writer settings |
| | 1211 | docs`_ for details. |
| | 1212 | |
| | 1213 | .. _writer settings docs: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer |
| | 1214 | |
| 1171 | 1215 | .. setting:: ROOT_URLCONF |
| 1172 | 1216 | |
| 1173 | 1217 | ROOT_URLCONF |
diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt
|
a
|
b
|
|
| 702 | 702 | |
| 703 | 703 | Normally, Django will load all the configuration information it needs from its |
| 704 | 704 | own default configuration file, combined with the settings in the module given |
| 705 | | in the :setting:`DJANGO_SETTINGS_MODULE` environment variable. But if you're |
| | 705 | in the :envvar:`DJANGO_SETTINGS_MODULE` environment variable. But if you're |
| 706 | 706 | using the template system independently of the rest of Django, the environment |
| 707 | 707 | variable approach isn't very convenient, because you probably want to configure |
| 708 | 708 | the template system in line with the rest of your application rather than |
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
|
a
|
b
|
|
| 401 | 401 | --------------------- |
| 402 | 402 | |
| 403 | 403 | Regardless of the value of the :setting:`DEBUG` setting in your configuration |
| 404 | | file, all Django tests run with :setting:`DEBUG=False`. This is to ensure that |
| | 404 | file, all Django tests run with :setting:`DEBUG`\=False. This is to ensure that |
| 405 | 405 | the observed output of your code matches what will be seen in a production |
| 406 | 406 | setting. |
| 407 | 407 | |