web/formfields.py
branchstable
changeset 3689 deb13e88e037
parent 3575 4123323acaea
child 3720 5376aaadd16b
child 3790 34fdb8fb49d1
equal deleted inserted replaced
3688:421fb447ecb2 3689:deb13e88e037
   522     fieldclass = None
   522     fieldclass = None
   523     card = eschema.cardinality(rschema, role)
   523     card = eschema.cardinality(rschema, role)
   524     if role == 'subject':
   524     if role == 'subject':
   525         targetschema = rschema.objects(eschema)[0]
   525         targetschema = rschema.objects(eschema)[0]
   526         help = rschema.rproperty(eschema, targetschema, 'description')
   526         help = rschema.rproperty(eschema, targetschema, 'description')
   527         if rschema.is_final():
   527         if rschema.final:
   528             if rschema.rproperty(eschema, targetschema, 'internationalizable'):
   528             if rschema.rproperty(eschema, targetschema, 'internationalizable'):
   529                 kwargs.setdefault('internationalizable', True)
   529                 kwargs.setdefault('internationalizable', True)
   530             def get_default(form, es=eschema, rs=rschema):
   530             def get_default(form, es=eschema, rs=rschema):
   531                 return es.default(rs)
   531                 return es.default(rs)
   532             kwargs.setdefault('initial', get_default)
   532             kwargs.setdefault('initial', get_default)
   538     if role == 'object':
   538     if role == 'object':
   539         kwargs.setdefault('label', (eschema.type, rschema.type + '_object'))
   539         kwargs.setdefault('label', (eschema.type, rschema.type + '_object'))
   540     else:
   540     else:
   541         kwargs.setdefault('label', (eschema.type, rschema.type))
   541         kwargs.setdefault('label', (eschema.type, rschema.type))
   542     kwargs.setdefault('help', help)
   542     kwargs.setdefault('help', help)
   543     if rschema.is_final():
   543     if rschema.final:
   544         if skip_meta_attr and rschema in eschema.meta_attributes():
   544         if skip_meta_attr and rschema in eschema.meta_attributes():
   545             return None
   545             return None
   546         fieldclass = FIELDS[targetschema]
   546         fieldclass = FIELDS[targetschema]
   547         if fieldclass is StringField:
   547         if fieldclass is StringField:
   548             if targetschema == 'Password':
   548             if targetschema == 'Password':