web/views/cwproperties.py
changeset 2234 1fbcf202882d
parent 2181 94ca417b9b07
parent 2225 16826403affa
child 2381 caad2367d940
equal deleted inserted replaced
2209:2b91abd9f5a4 2234:1fbcf202882d
   297     def vocabulary(self, form):
   297     def vocabulary(self, form):
   298         entity = form.edited_entity
   298         entity = form.edited_entity
   299         _ = form.req._
   299         _ = form.req._
   300         if entity.has_eid():
   300         if entity.has_eid():
   301             return [(_(entity.pkey), entity.pkey)]
   301             return [(_(entity.pkey), entity.pkey)]
   302         # key beginning with 'system.' should usually not be edited by hand
       
   303         choices = entity.vreg.user_property_keys()
   302         choices = entity.vreg.user_property_keys()
   304         return [(u'', u'')] + sorted(zip((_(v) for v in choices), choices))
   303         return [(u'', u'')] + sorted(zip((_(v) for v in choices), choices))
   305 
   304 
   306     
   305 
   307 class PropertyValueField(StringField):
   306 class PropertyValueField(StringField):
   308     """specific field for CWProperty.value  which will be different according to
   307     """specific field for CWProperty.value  which will be different according to
   309     the selected key type and vocabulary information
   308     the selected key type and vocabulary information
   310     """
   309     """
   311     widget = PlaceHolderWidget
   310     widget = PlaceHolderWidget