web/form.py
branchtls-sprint
changeset 913 5dfba71b1872
parent 911 467fb77c6a33
parent 910 a86ab461b8fd
child 944 e9da555f19c5
equal deleted inserted replaced
912:9ad0867692e1 913:5dfba71b1872
   273         values = form.context[field]['value']
   273         values = form.context[field]['value']
   274         if not isinstance(values, (tuple, list)):
   274         if not isinstance(values, (tuple, list)):
   275             values = (values,)
   275             values = (values,)
   276         attrs = dict(self.attrs)
   276         attrs = dict(self.attrs)
   277         attrs['id'] = form.context[field]['id']
   277         attrs['id'] = form.context[field]['id']
   278         return name, values, dict(self.attrs)
   278         return name, values, attrs
   279 
   279 
   280 class Input(FieldWidget):
   280 class Input(FieldWidget):
   281     type = None
   281     type = None
   282     
   282     
   283     def render(self, form, field):
   283     def render(self, form, field):
   399         req.html_headers.define_var('MONTHNAMES', monthnames)
   399         req.html_headers.define_var('MONTHNAMES', monthnames)
   400         req.html_headers.define_var('DAYNAMES', daynames)
   400         req.html_headers.define_var('DAYNAMES', daynames)
   401     
   401     
   402     def render(self, form, field):
   402     def render(self, form, field):
   403         txtwidget = super(DateTimePicker, self).render(form, field)
   403         txtwidget = super(DateTimePicker, self).render(form, field)
       
   404         self.add_localized_infos(form.req)
   404         cal_button = self._render_calendar_popup(form, field)
   405         cal_button = self._render_calendar_popup(form, field)
   405         return txtwidget + cal_button
   406         return txtwidget + cal_button
   406     
   407     
   407     def _render_calendar_popup(self, form, field):
   408     def _render_calendar_popup(self, form, field):
   408         req = form.req
   409         req = form.req