web/views/editforms.py
changeset 2686 c700ace6ebfd
parent 2679 3fa8c0cec760
child 2789 39712da6f397
child 3062 a8e901fc4457
child 3384 f76a38731bc1
equal deleted inserted replaced
2685:0518ca8f63e3 2686:c700ace6ebfd
    93         w(u'</ul>\n')
    93         w(u'</ul>\n')
    94         w(form.form_render())
    94         w(form.form_render())
    95 
    95 
    96 
    96 
    97 class ClickAndEditFormView(FormViewMixIn, EntityView):
    97 class ClickAndEditFormView(FormViewMixIn, EntityView):
    98     """form used to permit ajax edition of an attribute of an entity in a view
    98     """form used to permit ajax edition of a relation or attribute of an entity
    99 
    99     in a view, if logged user have the permission to edit it.
   100     (double-click on the field to see an appropriate edition widget)
   100 
       
   101     (double-click on the field to see an appropriate edition widget).
   101     """
   102     """
   102     id = 'doreledit'
   103     id = 'doreledit'
   103     __select__ = non_final_entity() & match_kwargs('rtype')
   104     __select__ = non_final_entity() & match_kwargs('rtype')
   104     # FIXME editableField class could be toggleable from userprefs
   105     # FIXME editableField class could be toggleable from userprefs
   105 
   106 
   270         vid = dispctrl.get('vid', 'reledit')
   271         vid = dispctrl.get('vid', 'reledit')
   271         if vid != 'reledit': # reledit explicitly disabled
   272         if vid != 'reledit': # reledit explicitly disabled
   272             self.wview(vid, entity.related(rtype, role), 'null')
   273             self.wview(vid, entity.related(rtype, role), 'null')
   273             return False
   274             return False
   274         if eschema.role_rproperty(role, rschema, 'composite') == role:
   275         if eschema.role_rproperty(role, rschema, 'composite') == role:
   275             self.warning('reledit cannot be applied : (... %s %s [composite])'
       
   276                          % (rschema, eschema))
       
   277             self.wview(rvid, entity.related(rtype, role), 'null')
   276             self.wview(rvid, entity.related(rtype, role), 'null')
   278             return False
   277             return False
   279         return super(AutoClickAndEditFormView, self).should_edit_relation(
   278         return super(AutoClickAndEditFormView, self).should_edit_relation(
   280             entity, rschema, role, rvid)
   279             entity, rschema, role, rvid)
   281 
   280