From 4ef10f245ada0c7d5ae8dc31eebffa63790d40fb Mon Sep 17 00:00:00 2001 From: Anders Steinlein Date: Wed, 5 Mar 2014 21:19:40 +0100 Subject: Fixed #17642 -- Added min_num support to modelformsets, inlines, and the admin. Thanks Stephen Burrows for work on the patch as well. Forwardport of 2914f66983a92fcae55673c517dd8d01e8c238c4 from stable/1.7.x --- docs/ref/checks.txt | 3 ++- docs/ref/contrib/admin/index.txt | 20 ++++++++++++++++++++ docs/ref/contrib/contenttypes.txt | 6 +++++- docs/ref/forms/models.txt | 4 ++-- 4 files changed, 29 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index 67dc335d80..c8e97df660 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -205,7 +205,8 @@ inline on a :class:`~django.contrib.admin.ModelAdmin`. * **admin.E202**: ```` has no ForeignKey to ````./```` has more than one ForeignKey to ````. * **admin.E203**: The value of ``extra`` must be an integer. * **admin.E204**: The value of ``max_num`` must be an integer. -* **admin.E205**: The value of ``formset`` must inherit from ``BaseModelFormSet``. +* **admin.E205**: The value of ``min_num`` must be an integer. +* **admin.E206**: The value of ``formset`` must inherit from ``BaseModelFormSet``. GenericInlineModelAdmin ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 1a02d3fc3b..876bf290c3 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1966,6 +1966,16 @@ The ``InlineModelAdmin`` class adds: :meth:`InlineModelAdmin.get_max_num` also allows you to customize the maximum number of extra forms. +.. attribute:: InlineModelAdmin.min_num + + .. versionadded:: 1.7 + + This controls the minimum number of forms to show in the inline. + See :func:`~django.forms.models.modelformset_factory` for more information. + + :meth:`InlineModelAdmin.get_min_num` also allows you to customize the + minimum number of displayed forms. + .. attribute:: InlineModelAdmin.raw_id_fields By default, Django's admin uses a select-box interface (