Skip to content

Instantly share code, notes, and snippets.

@Gautier
Created April 17, 2012 16:15
Show Gist options
  • Save Gautier/2407244 to your computer and use it in GitHub Desktop.
Save Gautier/2407244 to your computer and use it in GitHub Desktop.
DatePickerMixIn
class DatePickerMixIn(object):
def prepare_datefields(self):
for field in self.fields:
if isinstance(self.fields[field], forms.fields.DateField):
self.fields[field].widget.attrs.update({'class':'datepicker'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment