class EditEventForm(FlaskForm): title = StringField('Title', validators=[Length(min=1, max=50)], render_kw={"placeholder": "Title"}) area = StringField('Area', validators=[Length(min=4, max=50)], render_kw={"placeholder": "Area"}) start_date = DateTimeField( 'Starting Time', format="20%y-%m-%d %H:%M:%S", render_kw={"placeholder": "Year-Month-Day Hour:Minutes:Seconds"}, widget=DateTimePickerWidget()) end_date = DateTimeField( 'Ending Time', format="20%y-%m-%d %H:%M:%S", render_kw={"placeholder": "Year-Month-Day Hour:Minutes:Seconds"}, widget=DateTimePickerWidget()) desc = StringField('Description', widget=TextArea(), render_kw={"placeholder": "Description"}) image = FileField('Event Image') submit = SubmitField('Edit Event')
class EventsForm(form.Form): name = fields.TextField('Name') start = DateTimeField('Start Time', widget=DateTimePickerWidget()) end = DateTimeField('End Time', widget=DateTimePickerWidget())
def handle_datetime_tz_field(self, model, field, **kwargs): kwargs['widget'] = DateTimePickerWidget() return field.name, fields.DateTimeField(**kwargs)