Author: timo Date: 2010-12-27 07:41:19 -0600 (Mon, 27 Dec 2010) New Revision: 15066
Modified: django/trunk/docs/ref/contrib/admin/index.txt Log: Fixed #12642 - Add docs for has_[add|change|delete]_permission ModelAdmin methods. Thanks to MadeR for the report and for the wiki contributors from which I took language for this patch. Modified: django/trunk/docs/ref/contrib/admin/index.txt =================================================================== --- django/trunk/docs/ref/contrib/admin/index.txt 2010-12-27 13:28:04 UTC (rev 15065) +++ django/trunk/docs/ref/contrib/admin/index.txt 2010-12-27 13:41:19 UTC (rev 15066) @@ -921,6 +921,27 @@ kwargs["queryset"] = Car.objects.filter(owner=request.user) return super(MyModelAdmin, self).formfield_for_manytomany(db_field, request, **kwargs) +.. method:: ModelAdmin.has_add_permission(self, request) + + Should return ``True`` if adding an object is permitted, ``False`` + otherwise. + +.. method:: ModelAdmin.has_change_permission(self, request, obj=None) + + Should return ``True`` if editing obj is permitted, ``False`` otherwise. + If obj is ``None``, should return ``True`` or ``False`` to indicate whether + editing of objects of this type is permitted in general (e.g., ``False`` + will be interpreted as meaning that the current user is not permitted to + edit any object of this type). + +.. method:: ModelAdmin.has_delete_permission(self, request, obj=None) + + Should return ``True`` if deleting obj is permitted, ``False`` otherwise. + If obj is ``None``, should return ``True`` or ``False`` to indicate whether + deleting objects of this type is permitted in general (e.g., ``False`` will + be interpreted as meaning that the current user is not permitted to delete + any object of this type). + .. method:: ModelAdmin.queryset(self, request) The ``queryset`` method on a ``ModelAdmin`` returns a -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.