djangosnippets.org: Latest snippets posted by gnrfanhttps://djangosnippets.org/users/gnrfan/2012-05-26T22:48:23.189925-05:00gnrfanPatchModelForm - A ModelForm subclass with the semantics of the PATCH HTTP method
2012-05-26T22:48:23.189925-05:00gnrfanhttps://djangosnippets.org/snippets/2758/<p>Use this class to partially update one or more fields of a model. Only the fields that are bound to the form via the "data" parameter in the constructor get updated. All automatically generated fields have their "required" attribute set to False.</p>
<p>Example 1:</p>
<pre><code>from django.contrib.auth.models import User
class PatchUserForm(PatchModelForm): …</code></pre>
Freely redistributableHorizontal RadioSelect widget
2012-02-27T11:22:12.285855-06:00gnrfanhttps://djangosnippets.org/snippets/2696/<p>The problem with Django's default Radio button widget is that it puts the buttons in a vertical format and the documentation is somewhat silent on how to make them horizontal. If you are dealing with a long list of buttons then veritical is probably the way to go but if …</p>
Freely redistributable