Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Created February 27, 2014 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/9254405 to your computer and use it in GitHub Desktop.
Save stuaxo/9254405 to your computer and use it in GitHub Desktop.
attempt to make django checkboxes horizontal
class SomeModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(MessageModelForm, self).__init__(*args, **kwargs)
for f in self.fields.values():
if isinstance(f.widget, widgets.CheckboxInput):
f.widget.attrs.update({'class': "checkbox inline"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment