Created
February 27, 2014 17:05
-
-
Save stuaxo/9254405 to your computer and use it in GitHub Desktop.
attempt to make django checkboxes horizontal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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