card referenced later
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Dec 2009 16:46:56 +0100
changeset 4044 3876c894e018
parent 4043 39ae94e0c8b8
child 4045 f4a52abb6f4f
card referenced later
web/formfields.py
--- a/web/formfields.py	Tue Dec 08 16:45:01 2009 +0100
+++ b/web/formfields.py	Tue Dec 08 16:46:56 2009 +0100
@@ -594,7 +594,8 @@
             kwargs.setdefault('initial', get_default)
     else:
         targetschema = rdef.subject
-    kwargs['required'] = rdef.role_cardinality(role) in '1+'
+    card = rdef.role_cardinality(role)
+    kwargs['required'] = card in '1+'
     kwargs['name'] = rschema.type
     if role == 'object':
         kwargs.setdefault('label', (eschema.type, rschema.type + '_object'))