djangosnippets.org: Latest snippets tagged with 'attributes'https://djangosnippets.org/tags/attributes/2010-05-31T00:35:46.486240-05:00Dynamically alter the attributes of a formset
2010-05-31T00:35:46.486240-05:00cronosahttps://djangosnippets.org/snippets/2043/<p>Allow you to specify a "General case formset/modelformset" and then alter the attributes of that formset, specificly: extra, can_order, can_delete and max_num.</p>
<p>So you specify:</p>
<blockquote>
<blockquote>
<blockquote>
<p>formset = AuthorFormSet(queryset=Author.objects.filter(name__startswith='O'))
and then you want to dynamically add multiple fields with javascript and save the new ones. By default a formset only has …</p></blockquote></blockquote></blockquote>
Freely redistributable