@@ -71,7 +71,7 @@ the collection is used to glue them together.
7171 :caption: forms.py
7272
7373 from django.forms import fields, forms
74- from formset.collection import FormCollection
74+ from formset.collection import AddSiblingActivator, FormCollection
7575 from formset.formfields.collection import CollectionField
7676 from formset.formfields.richtext import RichTextField
7777 from formset.forms import ModelForm
@@ -95,13 +95,14 @@ the collection is used to glue them together.
9595
9696 class SlideCollection(FormCollection):
9797 legend = "Carousel Slides"
98- add_label = "Add Slide"
9998 min_siblings = 1
10099 max_siblings = 10
101100 is_sortable = True
102101 slide_form = SlideForm()
102+ induce_add_sibling = '.add_slide:active'
103103 ignore_marked_for_removal = True
104-
104+ add_slide = AddSiblingActivator("Add Slide")
105+
105106 class CarouselForm(ModelForm):
106107 auto_start = fields.BooleanField(
107108 label="Auto Start",
@@ -193,9 +194,10 @@ stored. We therefore can map the field named ``context`` directly onto the equal
193194 extra_siblings = 0
194195 accordion_item = AccordionItem()
195196 legend = "Accordion"
196- add_label = "Add Accordion Item"
197+ induce_add_sibling = '.add_accordion_item:active'
197198 ignore_marked_for_removal = True
198-
199+ add_accordion_item = AddSiblingActivator("Add Accordion Item")
200+
199201 class AccordionForm(ModelForm):
200202 context = CollectionField(AccordionCollection)
201203
0 commit comments