32
30
-------------------------------------------------------------------
34
32
Set the :setting:`CACHE_MIDDLEWARE_ANONYMOUS_ONLY` setting to ``True``. See the
35
:ref:`cache documentation <topics-cache>` for more information.
33
:doc:`cache documentation </topics/cache>` for more information.
37
35
How do I automatically set a field's value to the user who last edited the object in the admin?
38
36
-----------------------------------------------------------------------------------------------
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.
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.
46
45
How do I limit admin access so that objects can only be edited by the users who created them?
47
46
---------------------------------------------------------------------------------------------
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.
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.
54
55
My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python.
55
56
---------------------------------------------------------------------------------------------------------------------------
91
92
presentation by editing the CSS stylesheet and/or associated image files. The
92
93
site is built using semantic HTML and plenty of CSS hooks, so any changes you'd
93
94
like to make should be possible by editing the stylesheet. We've got a
94
:ref:`guide to the CSS used in the admin <obsolete-admin-css>` to get you started.
95
:doc:`guide to the CSS used in the admin </obsolete/admin-css>` to get you started.