~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/faq/admin.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.1.12 upstream) (29.1.1 maverick-security)
  • Revision ID: james.westby@ubuntu.com-20101012113435-yy57c8tx6g9anf3e
Tags: 1.2.3-1ubuntu0.1
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _faq-admin:
2
 
 
3
1
FAQ: The admin
4
2
==============
5
3
 
32
30
-------------------------------------------------------------------
33
31
 
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.
36
34
 
37
35
How do I automatically set a field's value to the user who last edited the object in the admin?
38
36
-----------------------------------------------------------------------------------------------
39
37
 
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.
45
44
 
46
45
How do I limit admin access so that objects can only be edited by the users who created them?
47
46
---------------------------------------------------------------------------------------------
48
47
 
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.
53
54
 
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.
95
96