djangosnippets.org: Latest snippets tagged with 'fieldset'http://djangosnippets.org/tags/fieldset/2010-09-17T05:25:12.226136-05:00Initially open collapsable fieldset class in admin
2010-09-17T05:25:12.226136-05:00ralfzenhttp://djangosnippets.org/snippets/2200/<p>It's just an extension for the admin. Replace the collapse.js (collapse.min.js) and use it like this in the admin fieldset option: ´´<strong>'classes': ['collapse', 'open']</strong>´´.
Without the 'open'-class, it will work as usual.
<em>Needs possibly fixing for IE <= 8</em> because IE doesn't support the ´´:not´´ selector.
</p>
Freely redistributableFieldStack - easy form template rendering
2010-05-26T16:53:42.284344-05:00divermanhttp://djangosnippets.org/snippets/2040/<p>FieldStack simplifies forms template rendering. This is enhanced version of snippet <a href="http://djangosnippets.org/snippets/1786/">1786</a></p>
Freely redistributableRemove named field from fieldsets
2009-11-17T06:11:54.306996-06:00dokterbobhttp://djangosnippets.org/snippets/1803/<p>This snipped removes a specific fields from the fieldsets. This is very useful to leave a field 'out' in the admin, likewise:
</p>
<pre><code>def get_fieldsets(self, request, obj=None):
fieldsets = super(BlaModelAdmin, self).get_fieldsets(request, obj)
if not request.user.has_perm('change_blah'):
remove_from_fieldsets(fieldsets, ('blah',))
</code></pre>
Freely redistributableStacked/Grouped Forms 2 - easy rendering forms
2009-11-09T17:32:04.586247-06:00divermanhttp://djangosnippets.org/snippets/1786/<p>This snippet was inspired by <a href="http://www.djangosnippets.org/snippets/1783/">1783</a>. It allows simply create groups of fields for template rendering.</p>
Freely redistributableEasy Form Structuring
2009-07-28T08:33:06.876884-05:00jughttp://djangosnippets.org/snippets/1657/<p>With this, you can group form fields very easily. Since it does not create any html, you can use it not only to create fieldsets (with tables, lists, etc).</p>
Freely redistributableBetterForm with fieldsets and row_attrs
2009-02-08T08:48:08.141517-06:00carljmhttp://djangosnippets.org/snippets/1314/<p><strong>NOTE</strong>: Further development of this snippet will take place in the <a href="http://launchpad.net/django-form-utils">django-form-utils</a> project.</p>
<p>This snippet provides BetterForm and BetterModelForm classes which are subclasses of django.forms.Form and django.forms.ModelForm, respectively. BetterForm and BetterModelForm allow subdivision of forms into fieldsets which are iterable from a template, and also allow definition of row_attrs …</p>
Freely redistributableForm splitting/Fieldset templatetag
2008-09-04T08:09:40.037987-05:00peritushttp://djangosnippets.org/snippets/1019/<p>Syntax: <code>{% get_fieldset list,of,fields as new_form_object from original_form %}</code></p>
<p>Example:</p>
<pre><code>{% load fieldsets %}
...
<fieldset id="contact_details">
<legend>Contact details</legend>
<ul>
{% get_fieldset first_name,last_name,email,cell_phone as personal_fields from form %}
{{ personal_fields.as_ul }}
</ul>
</fieldset>
<fieldset>
<legend>Address details</legend>
<ul>
{% get_fieldset street_address,post_code,city as address_fields from form %}
{{ address_fields.as_ul }}
</ul>
</fieldset>
</code></pre>
Freely redistributableForms splitted in fieldsets
2008-03-25T12:31:29.984102-05:00gustavo80brhttp://djangosnippets.org/snippets/663/<p>This template tag build a Form splitted in fieldsets. The fieldsets are configured with a second parameter, that is a tuple like the one used in the Admin class in models in the attribute "fields".</p>
<p>You pass to the template the form and the tuple and than use them as …</p>
Freely redistributableWTForm (What The Form)
2007-05-03T13:52:06.707355-05:00chrjhttp://djangosnippets.org/snippets/214/<p>WTForm is an extension to the django newforms library allowing
the developer, in a very flexible way, to layout the form
fields using fieldsets and columns</p>
<p>WTForm was built with the well-documented <a href="http://developer.yahoo.com/yui/grids/">YUI Grid CSS</a> in
mind when rendering the columns and fields. This should make
it easy to implement …</p>
Freely redistributableFieldsetForm
2007-04-09T06:24:38.428795-05:00Ciantichttp://djangosnippets.org/snippets/164/<p>This is FieldsetForm for rendering forms with fieldsets. This is not in anyway final version of this snippet. This is preliminary version which just works. One can easilly implement the <code>as_ul</code>, <code>as_p</code> at the end with just looking the <code>as_table</code> definition.</p>
<blockquote>
<p>Content developers should group information where natural and …</p></blockquote>
Freely redistributable