select tag now accepts a multiple argument tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 20 Feb 2009 15:46:38 +0100
branchtls-sprint
changeset 895 e78ae38506db
parent 894 e1f848785e3d
child 896 6e0379fc1988
select tag now accepts a multiple argument
common/tags.py
--- a/common/tags.py	Fri Feb 20 15:40:28 2009 +0100
+++ b/common/tags.py	Fri Feb 20 15:46:38 2009 +0100
@@ -13,9 +13,13 @@
 span = tag('span')
 img = tag('img')
 label = tag('label')
+option = tag('option')
 
-def select(name, options=[]):
-    html = [u'<select name="%s">' % name]
+def select(name, multiple=False, options=[]):
+    if multiple:
+        html = [u'<select name="%s" multiple="multiple">' % name]
+    else:
+        html = [u'<select name="%s">' % name]
     html += options
     html.append(u'</select>')
     return u'\n'.join(html)