djangosnippets.org: Latest snippets tagged with 'django-forms'http://djangosnippets.org/tags/django-forms/2018-04-30T18:44:16.122844-05:00Support disabling options in a select widget
2018-04-30T18:44:16.122844-05:00jackton1http://djangosnippets.org/snippets/10646/<p>Provide the ability to disable a select option with Django2. This can be done during the widget initialization (i.e when the widget field is created) or during form initialization.</p>
<p>This will disable the select option based on a context or by specifying the values that should be disabled.</p>
Freely redistributableinline forms for deeply nested models
2017-10-15T02:31:28.828173-05:00cdrandinhttp://djangosnippets.org/snippets/10627/<p>I had a problem trying to display my model would have a foreign key and that model would have one too etc.</p>
<p>Now there was a point I wanted to display the foreign keys of that field and display its fields and so on so forth.</p>
<p>This pretty much expands …</p>
Freely redistributableA widget that renders JSON data as separate editable inputs.
2013-07-16T19:53:06.692353-05:00abbasovalexhttp://djangosnippets.org/snippets/2974/<p>You can see full examples on the page <a href="https://github.com/abbasovalex/django-SplitJSONWidget-form">GitHub</a></p>
Freely redistributableDjango Number Input
2011-02-08T16:16:29.641899-06:00silent1mezzohttp://djangosnippets.org/snippets/2354/<p>This will give you a <input type='number'> field.
</p>
<p>This is helpful when you want to use HTML5 for newer browsers. Older browsers will just interpret this as <input type='text'>
</p>
Freely redistributable