--- a/web/formfields.py Tue Aug 04 17:00:14 2009 +0200
+++ b/web/formfields.py Tue Aug 04 17:01:00 2009 +0200
@@ -14,7 +14,7 @@
from yams.constraints import (SizeConstraint, StaticVocabularyConstraint,
FormatConstraint)
-from cubicweb.utils import ustrftime, compute_cardinality
+from cubicweb.utils import ustrftime
from cubicweb.common import tags, uilib
from cubicweb.web import INTERNAL_FIELD_VALUE
from cubicweb.web.formwidgets import (
@@ -490,9 +490,9 @@
'subjschema rschema objschema' according to information found in the schema
"""
fieldclass = None
+ card = eschema.cardinality(rschema, role)
if role == 'subject':
targetschema = rschema.objects(eschema)[0]
- card = compute_cardinality(eschema, rschema, role)
help = rschema.rproperty(eschema, targetschema, 'description')
if rschema.is_final():
if rschema.rproperty(eschema, targetschema, 'internationalizable'):
@@ -502,7 +502,6 @@
kwargs.setdefault('initial', get_default)
else:
targetschema = rschema.subjects(eschema)[0]
- card = compute_cardinality(eschema, rschema, role)
help = rschema.rproperty(targetschema, eschema, 'description')
kwargs['required'] = card in '1+'
kwargs['name'] = rschema.type