diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2014-01-22 22:17:32 +0100 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2014-01-22 22:59:55 +0100 |
| commit | 6bca149af5b8e2d6fb6fe19bdb53904f07248033 (patch) | |
| tree | 7a121ab9550a1ac60855296a55426c5719de9fd1 /docs/ref | |
| parent | 8eca53f0bef783e5c11877fe18a6651543605af1 (diff) | |
[1.6.x] Don't show `self` in the list of arguments of a method.
This is consistent with Python's official documentation
and it's a sphinx recommendation too[1].
[1] http://sphinx-doc.org/markup/desc.html#dir-method
Refs #21855.
Backport of 79e1d6ebd70898d514a44b85648e3d24104c4243 from master.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 68 | ||||
| -rw-r--r-- | docs/ref/contrib/auth.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/gis/gdal.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/syndication.txt | 2 | ||||
| -rw-r--r-- | docs/ref/forms/widgets.txt | 2 |
5 files changed, 38 insertions, 38 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index ae0fd8214a..a62e8575b8 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1097,7 +1097,7 @@ templates used by the :class:`ModelAdmin` views: save/delete the object, they are not for veto purposes, rather they allow you to perform extra operations. -.. method:: ModelAdmin.save_model(self, request, obj, form, change) +.. method:: ModelAdmin.save_model(request, obj, form, change) The ``save_model`` method is given the ``HttpRequest``, a model instance, a ``ModelForm`` instance and a boolean value based on whether it is adding @@ -1112,12 +1112,12 @@ templates used by the :class:`ModelAdmin` views: obj.user = request.user obj.save() -.. method:: ModelAdmin.delete_model(self, request, obj) +.. method:: ModelAdmin.delete_model(request, obj) The ``delete_model`` method is given the ``HttpRequest`` and a model instance. Use this method to do pre- or post-delete operations. -.. method:: ModelAdmin.save_formset(self, request, form, formset, change) +.. method:: ModelAdmin.save_formset(request, form, formset, change) The ``save_formset`` method is given the ``HttpRequest``, the parent ``ModelForm`` instance and a boolean value based on whether it is adding or @@ -1134,7 +1134,7 @@ templates used by the :class:`ModelAdmin` views: instance.save() formset.save_m2m() -.. method:: ModelAdmin.get_ordering(self, request) +.. method:: ModelAdmin.get_ordering(request) The ``get_ordering`` method takes a``request`` as parameter and is expected to return a ``list`` or ``tuple`` for ordering similar @@ -1148,7 +1148,7 @@ templates used by the :class:`ModelAdmin` views: else: return ['name'] -.. method:: ModelAdmin.get_search_results(self, request, queryset, search_term) +.. method:: ModelAdmin.get_search_results(request, queryset, search_term) .. versionadded:: 1.6 @@ -1181,7 +1181,7 @@ templates used by the :class:`ModelAdmin` views: pass return queryset, use_distinct -.. method:: ModelAdmin.save_related(self, request, form, formsets, change) +.. method:: ModelAdmin.save_related(request, form, formsets, change) The ``save_related`` method is given the ``HttpRequest``, the parent ``ModelForm`` instance, the list of inline formsets and a boolean value @@ -1189,28 +1189,28 @@ templates used by the :class:`ModelAdmin` views: pre- or post-save operations for objects related to the parent. Note that at this point the parent object and its form have already been saved. -.. method:: ModelAdmin.get_readonly_fields(self, request, obj=None) +.. method:: ModelAdmin.get_readonly_fields(request, obj=None) The ``get_readonly_fields`` method is given the ``HttpRequest`` and the ``obj`` being edited (or ``None`` on an add form) and is expected to return a ``list`` or ``tuple`` of field names that will be displayed as read-only, as described above in the :attr:`ModelAdmin.readonly_fields` section. -.. method:: ModelAdmin.get_prepopulated_fields(self, request, obj=None) +.. method:: ModelAdmin.get_prepopulated_fields(request, obj=None) The ``get_prepopulated_fields`` method is given the ``HttpRequest`` and the ``obj`` being edited (or ``None`` on an add form) and is expected to return a ``dictionary``, as described above in the :attr:`ModelAdmin.prepopulated_fields` section. -.. method:: ModelAdmin.get_list_display(self, request) +.. method:: ModelAdmin.get_list_display(request) The ``get_list_display`` method is given the ``HttpRequest`` and is expected to return a ``list`` or ``tuple`` of field names that will be displayed on the changelist view as described above in the :attr:`ModelAdmin.list_display` section. -.. method:: ModelAdmin.get_list_display_links(self, request, list_display) +.. method:: ModelAdmin.get_list_display_links(request, list_display) The ``get_list_display_links`` method is given the ``HttpRequest`` and the ``list`` or ``tuple`` returned by :meth:`ModelAdmin.get_list_display`. @@ -1218,14 +1218,14 @@ templates used by the :class:`ModelAdmin` views: changelist that will be linked to the change view, as described in the :attr:`ModelAdmin.list_display_links` section. -.. method:: ModelAdmin.get_fieldsets(self, request, obj=None) +.. method:: ModelAdmin.get_fieldsets(request, obj=None) The ``get_fieldsets`` method is given the ``HttpRequest`` and the ``obj`` being edited (or ``None`` on an add form) and is expected to return a list of two-tuples, in which each two-tuple represents a ``<fieldset>`` on the admin form page, as described above in the :attr:`ModelAdmin.fieldsets` section. -.. method:: ModelAdmin.get_list_filter(self, request) +.. method:: ModelAdmin.get_list_filter(request) .. versionadded:: 1.5 @@ -1233,7 +1233,7 @@ templates used by the :class:`ModelAdmin` views: to return the same kind of sequence type as for the :attr:`~ModelAdmin.list_filter` attribute. -.. method:: ModelAdmin.get_inline_instances(self, request, obj=None) +.. method:: ModelAdmin.get_inline_instances(request, obj=None) .. versionadded:: 1.5 @@ -1243,7 +1243,7 @@ templates used by the :class:`ModelAdmin` views: objects, as described below in the :class:`~django.contrib.admin.InlineModelAdmin` section. -.. method:: ModelAdmin.get_urls(self) +.. method:: ModelAdmin.get_urls() The ``get_urls`` method on a ``ModelAdmin`` returns the URLs to be used for that ModelAdmin in the same way as a URLconf. Therefore you can extend @@ -1308,7 +1308,7 @@ templates used by the :class:`ModelAdmin` views: (r'^my_view/$', self.admin_site.admin_view(self.my_view, cacheable=True)) -.. method:: ModelAdmin.get_form(self, request, obj=None, **kwargs) +.. method:: ModelAdmin.get_form(request, obj=None, **kwargs) Returns a :class:`~django.forms.ModelForm` class for use in the admin add and change views, see :meth:`add_view` and :meth:`change_view`. @@ -1323,7 +1323,7 @@ templates used by the :class:`ModelAdmin` views: self.exclude.append('field_to_hide') return super(MyModelAdmin, self).get_form(request, obj, **kwargs) -.. method:: ModelAdmin.get_formsets(self, request, obj=None) +.. method:: ModelAdmin.get_formsets(request, obj=None) Yields :class:`InlineModelAdmin`\s for use in admin add and change views. @@ -1340,7 +1340,7 @@ templates used by the :class:`ModelAdmin` views: continue yield inline.get_formset(request, obj) -.. method:: ModelAdmin.formfield_for_foreignkey(self, db_field, request, **kwargs) +.. method:: ModelAdmin.formfield_for_foreignkey(db_field, request, **kwargs) The ``formfield_for_foreignkey`` method on a ``ModelAdmin`` allows you to override the default formfield for a foreign keys field. For example, to @@ -1355,7 +1355,7 @@ templates used by the :class:`ModelAdmin` views: This uses the ``HttpRequest`` instance to filter the ``Car`` foreign key field to only display the cars owned by the ``User`` instance. -.. method:: ModelAdmin.formfield_for_manytomany(self, db_field, request, **kwargs) +.. method:: ModelAdmin.formfield_for_manytomany(db_field, request, **kwargs) Like the ``formfield_for_foreignkey`` method, the ``formfield_for_manytomany`` method can be overridden to change the @@ -1370,7 +1370,7 @@ templates used by the :class:`ModelAdmin` views: kwargs["queryset"] = Car.objects.filter(owner=request.user) return super(MyModelAdmin, self).formfield_for_manytomany(db_field, request, **kwargs) -.. method:: ModelAdmin.formfield_for_choice_field(self, db_field, request, **kwargs) +.. method:: ModelAdmin.formfield_for_choice_field(db_field, request, **kwargs) Like the ``formfield_for_foreignkey`` and ``formfield_for_manytomany`` methods, the ``formfield_for_choice_field`` method can be overridden to @@ -1389,13 +1389,13 @@ templates used by the :class:`ModelAdmin` views: kwargs['choices'] += (('ready', 'Ready for deployment'),) return super(MyModelAdmin, self).formfield_for_choice_field(db_field, request, **kwargs) -.. method:: ModelAdmin.get_changelist(self, request, **kwargs) +.. method:: ModelAdmin.get_changelist(request, **kwargs) Returns the ``Changelist`` class to be used for listing. By default, ``django.contrib.admin.views.main.ChangeList`` is used. By inheriting this class you can change the behavior of the listing. -.. method:: ModelAdmin.get_changelist_form(self, request, **kwargs) +.. method:: ModelAdmin.get_changelist_form(request, **kwargs) Returns a :class:`~django.forms.ModelForm` class for use in the ``Formset`` on the changelist page. To use a custom form, for example:: @@ -1421,7 +1421,7 @@ templates used by the :class:`ModelAdmin` views: omit the ``Meta.model`` attribute, since ``ModelAdmin`` will provide the correct model to use. -.. method:: ModelAdmin.get_changelist_formset(self, request, **kwargs) +.. method:: ModelAdmin.get_changelist_formset(request, **kwargs) Returns a :ref:`ModelFormSet <model-formsets>` class for use on the changelist page if :attr:`~ModelAdmin.list_editable` is used. To use a @@ -1437,12 +1437,12 @@ templates used by the :class:`ModelAdmin` views: kwargs['formset'] = MyAdminFormSet return super(MyModelAdmin, self).get_changelist_formset(request, **kwargs) -.. method:: ModelAdmin.has_add_permission(self, request) +.. method:: ModelAdmin.has_add_permission(request) Should return ``True`` if adding an object is permitted, ``False`` otherwise. -.. method:: ModelAdmin.has_change_permission(self, request, obj=None) +.. method:: ModelAdmin.has_change_permission(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 @@ -1450,7 +1450,7 @@ templates used by the :class:`ModelAdmin` views: 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) +.. method:: ModelAdmin.has_delete_permission(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 @@ -1458,7 +1458,7 @@ templates used by the :class:`ModelAdmin` views: be interpreted as meaning that the current user is not permitted to delete any object of this type). -.. method:: ModelAdmin.get_queryset(self, request) +.. method:: ModelAdmin.get_queryset(request) The ``get_queryset`` method on a ``ModelAdmin`` returns a :class:`~django.db.models.query.QuerySet` of all model instances that @@ -1500,25 +1500,25 @@ templates used by the :class:`ModelAdmin` views: Other methods ~~~~~~~~~~~~~ -.. method:: ModelAdmin.add_view(self, request, form_url='', extra_context=None) +.. method:: ModelAdmin.add_view(request, form_url='', extra_context=None) Django view for the model instance addition page. See note below. -.. method:: ModelAdmin.change_view(self, request, object_id, form_url='', extra_context=None) +.. method:: ModelAdmin.change_view(request, object_id, form_url='', extra_context=None) Django view for the model instance edition page. See note below. -.. method:: ModelAdmin.changelist_view(self, request, extra_context=None) +.. method:: ModelAdmin.changelist_view(request, extra_context=None) Django view for the model instances change list/actions page. See note below. -.. method:: ModelAdmin.delete_view(self, request, object_id, extra_context=None) +.. method:: ModelAdmin.delete_view(request, object_id, extra_context=None) Django view for the model instance(s) deletion confirmation page. See note below. -.. method:: ModelAdmin.history_view(self, request, object_id, extra_context=None) +.. method:: ModelAdmin.history_view(request, object_id, extra_context=None) Django view for the page that shows the modification history for a given model instance. @@ -1789,13 +1789,13 @@ The ``InlineModelAdmin`` class adds: Specifies whether or not inline objects can be deleted in the inline. Defaults to ``True``. -.. method:: InlineModelAdmin.get_formset(self, request, obj=None, **kwargs) +.. method:: InlineModelAdmin.get_formset(request, obj=None, **kwargs) Returns a :class:`~django.forms.models.BaseInlineFormSet` class for use in admin add/change views. See the example for :class:`ModelAdmin.get_formsets`. -.. method:: InlineModelAdmin.get_extra(self, request, obj=None, **kwargs) +.. method:: InlineModelAdmin.get_extra(request, obj=None, **kwargs) .. versionadded:: 1.6 @@ -1815,7 +1815,7 @@ The ``InlineModelAdmin`` class adds: return extra - obj.binarytree_set.count() return extra -.. method:: InlineModelAdmin.get_max_num(self, request, obj=None, **kwargs) +.. method:: InlineModelAdmin.get_max_num(request, obj=None, **kwargs) .. versionadded:: 1.6 diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index 796517969e..22a2335e34 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -271,7 +271,7 @@ Manager methods See :ref:`Creating users <topics-auth-creating-users>` for example usage. - .. method:: create_superuser(self, username, email, password, **extra_fields) + .. method:: create_superuser(username, email, password, **extra_fields) Same as :meth:`create_user`, but sets :attr:`~models.User.is_staff` and :attr:`~models.User.is_superuser` to ``True``. diff --git a/docs/ref/contrib/gis/gdal.txt b/docs/ref/contrib/gis/gdal.txt index c68030673b..dd4498cca1 100644 --- a/docs/ref/contrib/gis/gdal.txt +++ b/docs/ref/contrib/gis/gdal.txt @@ -873,7 +873,7 @@ systems and coordinate transformation:: A string representing this envelope as a polygon in WKT format. - .. method:: expand_to_include(self, *args) + .. method:: expand_to_include(*args) Coordinate System Objects ========================= diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index f17b9d8237..fd37e1985c 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -137,7 +137,7 @@ into those elements. See `a complex example`_ below that uses a description template. - .. method:: Feed.get_context_data(self, **kwargs) + .. method:: Feed.get_context_data(**kwargs) .. versionadded:: 1.6 diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 080d1fea86..edf0326f51 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -216,7 +216,7 @@ foundation for custom widgets. The 'value' given is not guaranteed to be valid input, therefore subclass implementations should program defensively. - .. method:: value_from_datadict(self, data, files, name) + .. method:: value_from_datadict(data, files, name) Given a dictionary of data and this widget's name, returns the value of this widget. Returns ``None`` if a value wasn't provided. |
