--- a/web/formwidgets.py Fri Apr 10 16:47:15 2009 +0200
+++ b/web/formwidgets.py Fri Apr 10 16:48:03 2009 +0200
@@ -167,7 +167,10 @@
name, curvalues, attrs = self._render_attrs(form, field)
options = []
for label, value in field.vocabulary(form):
- if value in curvalues:
+ if value is None:
+ # handle separator
+ options.append(u'<optgroup label="%s"/>' % (label or ''))
+ elif value in curvalues:
options.append(tags.option(label, value=value, selected='selected'))
else:
options.append(tags.option(label, value=value))