web/views/cwproperties.py
branchstable
changeset 2225 16826403affa
parent 2161 200481e7b156
child 2234 1fbcf202882d
child 2312 af4d8f75c5db
equal deleted inserted replaced
2224:52041b014949 2225:16826403affa
   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