web/views/cwproperties.py
branchtls-sprint
changeset 1533 bcd4bfff658b
parent 1507 525965b1c23a
child 1537 788b5ca792bd
equal deleted inserted replaced
1532:111c52e0022f 1533:bcd4bfff658b
    21 from cubicweb.web.form import CompositeForm, EntityFieldsForm, FormViewMixIn
    21 from cubicweb.web.form import CompositeForm, EntityFieldsForm, FormViewMixIn
    22 from cubicweb.web.formfields import FIELDS, StringField
    22 from cubicweb.web.formfields import FIELDS, StringField
    23 from cubicweb.web.formwidgets import Select, Button, SubmitButton
    23 from cubicweb.web.formwidgets import Select, Button, SubmitButton
    24 
    24 
    25 _ = unicode
    25 _ = unicode
       
    26 
       
    27 uicfg.rfields.tag_relation(PropertyKeyField, ('CWProperty', 'pkey', '*'), 'subject')
       
    28 uicfg.rfields.tag_relation(PropertyValueField, ('CWProperty', 'value', '*'), 'subject')
    26 
    29 
    27 # some string we want to be internationalizable for nicer display of eproperty
    30 # some string we want to be internationalizable for nicer display of eproperty
    28 # groups
    31 # groups
    29 _('navigation')
    32 _('navigation')
    30 _('ui')
    33 _('ui')
   322                 self.choices = [(form.req._('yes'), '1'), (form.req._('no'), '')]
   325                 self.choices = [(form.req._('yes'), '1'), (form.req._('no'), '')]
   323             elif pdef['type'] in ('Float', 'Int'):
   326             elif pdef['type'] in ('Float', 'Int'):
   324                 wdg.attrs.setdefault('size', 3)
   327                 wdg.attrs.setdefault('size', 3)
   325         self.widget = wdg
   328         self.widget = wdg
   326 
   329 
   327 uicfg.rfields.set_rtag(PropertyKeyField, 'pkey', 'subject', 'CWProperty')
       
   328 uicfg.rfields.set_rtag(PropertyValueField, 'value', 'subject', 'CWProperty')
       
   329