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