Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Event(models.Model):
- ...
- start = models.DateTimeField()
- class SplitDateTime(forms.SplitDateTimeWidget):
- template_name = 'split_datetime.html'
- def __init__(self, attrs=None):
- widgets = (
- forms.SelectDateWidget,
- forms.TimeInput(
- attrs={'size': '5', 'placeholder': 'HH:MM', 'maxlength': '5'})
- )
- # Note that we're calling MultiWidget, not SplitDateTimeWidget, because
- # we want to define widgets.
- forms.MultiWidget.__init__(self, widgets, attrs)
Add Comment
Please, Sign In to add comment