Ticket #13740: django-can_delete-docs.diff

File django-can_delete-docs.diff, 5.8 KB (added by Alex, 5 years ago)
  • docs/ref/contrib/admin/index.txt

    diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
    index f7aefa4..ef89b2e 100644
    a b The difference between these two is merely the template used to render them. 
    10271027The ``InlineModelAdmin`` class is a subclass of ``ModelAdmin`` so it inherits
    10281028all the same functionality as well as some of its own:
    10291029
    1030 ``model``
    1031 ~~~~~~~~~
     1030.. attribute:: InlineModelAdmin.model
    10321031
    1033 The model in which the inline is using. This is required.
     1032    The model in which the inline is using. This is required.
    10341033
    1035 ``fk_name``
    1036 ~~~~~~~~~~~
     1034.. attribute:: InlineModelAdmin.fk_name
    10371035
    1038 The name of the foreign key on the model. In most cases this will be dealt
    1039 with automatically, but ``fk_name`` must be specified explicitly if there are
    1040 more than one foreign key to the same parent model.
     1036    The name of the foreign key on the model. In most cases this will be dealt
     1037    with automatically, but ``fk_name`` must be specified explicitly if there
     1038    are more than one foreign key to the same parent model.
    10411039
    1042 ``formset``
    1043 ~~~~~~~~~~~
     1040.. attribute:: InlineModelAdmin.formset
    10441041
    1045 This defaults to ``BaseInlineFormSet``. Using your own formset can give you
    1046 many possibilities of customization. Inlines are built around
    1047 :ref:`model formsets <model-formsets>`.
     1042    This defaults to ``BaseInlineFormSet``. Using your own formset can give you
     1043    many possibilities of customization. Inlines are built around
     1044    :ref:`model formsets <model-formsets>`.
    10481045
    1049 ``form``
    1050 ~~~~~~~~
     1046.. attribute:: InlineModelAdmin.form
    10511047
    1052 The value for ``form`` defaults to ``ModelForm``. This is what is
    1053 passed through to ``inlineformset_factory`` when creating the formset for this
    1054 inline.
     1048    The value for ``form`` defaults to ``ModelForm``. This is what is passed
     1049    through to ``inlineformset_factory`` when creating the formset for this
     1050    inline.
    10551051
    10561052.. _ref-contrib-admin-inline-extra:
    10571053
    1058 ``extra``
    1059 ~~~~~~~~~
     1054.. attribute:: InlineModelAdmin.extra
    10601055
    1061 This controls the number of extra forms the formset will display in addition
    1062 to the initial forms. See the
    1063 :ref:`formsets documentation <topics-forms-formsets>` for more information.
    10641056
    1065 .. versionadded:: 1.2
     1057    This controls the number of extra forms the formset will display in addition
     1058    to the initial forms. See the
     1059    :ref:`formsets documentation <topics-forms-formsets>` for more information.
     1060
     1061    .. versionadded:: 1.2
    10661062
    1067 For users with JavaScript-enabled browsers, an "Add another" link is
    1068 provided to enable any number of additional inlines to be added in
    1069 addition to those provided as a result of the ``extra`` argument.
     1063    For users with JavaScript-enabled browsers, an "Add another" link is
     1064    provided to enable any number of additional inlines to be added in addition
     1065    to those provided as a result of the ``extra`` argument.
    10701066
    1071 The dynamic link will not appear if the number of currently displayed
    1072 forms exceeds ``max_num``, or if the user does not have JavaScript
    1073 enabled.
     1067    The dynamic link will not appear if the number of currently displayed forms
     1068    exceeds ``max_num``, or if the user does not have JavaScript enabled.
    10741069
    10751070.. _ref-contrib-admin-inline-max-num:
    10761071
    1077 ``max_num``
    1078 ~~~~~~~~~~~
     1072.. attribute:: InlineModelAdmin.max_num
    10791073
    1080 This controls the maximum number of forms to show in the inline. This doesn't
    1081 directly correlate to the number of objects, but can if the value is small
    1082 enough. See :ref:`model-formsets-max-num` for more information.
     1074    This controls the maximum number of forms to show in the inline. This
     1075    doesn't directly correlate to the number of objects, but can if the value
     1076    is small enough. See :ref:`model-formsets-max-num` for more information.
    10831077
    1084 ``raw_id_fields``
    1085 ~~~~~~~~~~~~~~~~~
     1078.. attribute:: InlineModelAdmin.raw_id_fields
    10861079
    1087 By default, Django's admin uses a select-box interface (<select>) for
    1088 fields that are ``ForeignKey``. Sometimes you don't want to incur the
    1089 overhead of having to select all the related instances to display in the
    1090 drop-down.
     1080    By default, Django's admin uses a select-box interface (<select>) for
     1081    fields that are ``ForeignKey``. Sometimes you don't want to incur the
     1082    overhead of having to select all the related instances to display in the
     1083    drop-down.
    10911084
    1092 ``raw_id_fields`` is a list of fields you would like to change
    1093 into a ``Input`` widget for either a ``ForeignKey`` or ``ManyToManyField``::
     1085    ``raw_id_fields`` is a list of fields you would like to change into a
     1086    ``Input`` widget for either a ``ForeignKey`` or ``ManyToManyField``::
    10941087
    1095     class BookInline(admin.TabularInline):
    1096         model = Book
    1097         raw_id_fields = ("pages",)
     1088        class BookInline(admin.TabularInline):
     1089            model = Book
     1090            raw_id_fields = ("pages",)
    10981091
    1099 ``template``
    1100 ~~~~~~~~~~~~
    11011092
    1102 The template used to render the inline on the page.
     1093.. attribute:: InlineModelAdmin.template
    11031094
    1104 ``verbose_name``
    1105 ~~~~~~~~~~~~~~~~
     1095    The template used to render the inline on the page.
    11061096
    1107 An override to the ``verbose_name`` found in the model's inner ``Meta`` class.
     1097.. attribute:: InlineModelAdmin.verbose_name
    11081098
    1109 ``verbose_name_plural``
    1110 ~~~~~~~~~~~~~~~~~~~~~~~
     1099    An override to the ``verbose_name`` found in the model's inner ``Meta``
     1100    class.
     1101
     1102.. attribute:: InlineModelAdmin.verbose_name_plural
     1103
     1104    An override to the ``verbose_name_plural`` found in the model's inner
     1105    ``Meta`` class.
     1106
     1107.. attribute:: InlineModelAdmin.can_delete
     1108   
     1109    Specifies whether or not inline objects can be deleted in the inline.
     1110    Defaults to ``True``.
    11111111
    1112 An override to the ``verbose_name_plural`` found in the model's inner ``Meta``
    1113 class.
    11141112
    11151113Working with a model with two or more foreign keys to the same parent model
    11161114---------------------------------------------------------------------------
Back to Top