djangosnippets.org: Latest snippets tagged with 'alfonso'https://djangosnippets.org/tags/alfonso/2009-03-17T15:26:38.010549-05:00ChoiceField with widget in choice
2009-03-17T15:26:38.010549-05:00alfonsopalomareshttps://djangosnippets.org/snippets/1377/<p>This code creates a widget that we used to generate a list of radiobuttons as follows:</p>
<ul>
<li>
<p>Radio button 1
--Widget__1</p>
</li>
<li>
<p>Radio button 2
--Widget__2</p>
</li>
<li>
<p>Radio button 3
--Widget__3</p>
</li>
</ul>
<p>How to use it is:</p>
<p>`ImagenForm class (forms.ModelForm):
widget1 = forms.BooleanField ()
widget2 = forms.TextInput
widget3 = forms.ModelChoiceField (queryset = Modelo.objects.all ()) …</p>
Freely redistributable