provide a mini HTML select tag constructor tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 19 Feb 2009 21:31:18 +0100
branchtls-sprint
changeset 861 7985b5db2284
parent 849 8591d896db7e
child 862 ee560986e211
provide a mini HTML select tag constructor
common/tags.py
--- a/common/tags.py	Thu Feb 19 20:33:50 2009 +0100
+++ b/common/tags.py	Thu Feb 19 21:31:18 2009 +0100
@@ -13,3 +13,10 @@
 span = tag('span')
 img = tag('img')
 label = tag('label')
+
+def select(name, options=[]):
+    html = [u'<select name="%s">' % name]
+    html += options
+    html.append(u'</select>')
+    return u'\n'.join(html)
+