--- a/common/tags.py Fri Feb 20 17:39:56 2009 +0100
+++ b/common/tags.py Fri Feb 20 17:40:07 2009 +0100
@@ -15,11 +15,14 @@
label = tag('label')
option = tag('option')
-def select(name, multiple=False, options=[]):
+def select(name, id=None, multiple=False, options=[]):
+ attrs = {}
if multiple:
- html = [u'<select name="%s" multiple="multiple">' % name]
- else:
- html = [u'<select name="%s">' % name]
+ attrs['multiple'] = 'multiple'
+ if id:
+ attrs['id'] = id
+ html = [u'<select name="%s" %s>' % (name,
+ ' '.join('%s="%s"' % kv for kv in attrs.items()))]
html += options
html.append(u'</select>')
return u'\n'.join(html)
--- a/web/form.py Fri Feb 20 17:39:56 2009 +0100
+++ b/web/form.py Fri Feb 20 17:40:07 2009 +0100
@@ -275,7 +275,7 @@
values = (values,)
attrs = dict(self.attrs)
attrs['id'] = form.context[field]['id']
- return name, values, dict(self.attrs)
+ return name, values, attrs
class Input(FieldWidget):
type = None
@@ -401,6 +401,7 @@
def render(self, form, field):
txtwidget = super(DateTimePicker, self).render(form, field)
+ self.add_localized_infos(form.req)
cal_button = self._render_calendar_popup(form, field)
return txtwidget + cal_button