changeset 1448:9ab2ca1f385b

merged
author Pavel Sviderski <pavel@psviderski.name>
date Tue, 24 Jul 2012 17:16:41 +0200
parents 675eb7e1e8a8 (current diff) 368899856333 (diff)
children b472a506db2e
files
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/forms.py	Tue Jul 17 15:40:06 2012 +0200
+++ b/MoinMoin/forms.py	Tue Jul 24 17:16:41 2012 +0200
@@ -8,10 +8,9 @@
 """
 
 
-from functools import reduce
-from operator import add
+import re
 
-from flatland import Element, Form, String, Integer, Boolean, Enum, MultiValue, Dict
+from flatland import Element, Form, String, Integer, Boolean, Enum, Dict, JoinedString
 from flatland.validation import Validator, Present, IsEmail, ValueBetween, URLValidator, Converted, ValueAtLeast
 
 from MoinMoin.constants.forms import *
@@ -53,7 +52,7 @@
 Select = Enum.with_properties(widget=WIDGET_SELECT)
 
 # XXX Need a better one than plain text box
-Tags = MultiValue.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Tags'), optional=True)
+Tags = JoinedString.of(String).with_properties(widget=WIDGET_TEXT).using(label=L_('Tags'), optional=True, separator=', ', separator_regex=re.compile(r'\s*,\s*'))
 
 Search = Text.using(default=u'', optional=True).with_properties(widget=WIDGET_SEARCH, placeholder=L_("Search Query"))