web/views/formrenderers.py
changeset 4293 0c4bdb3d93fd
parent 4278 24736a127bf1
child 4314 e12ee4a009bc
equal deleted inserted replaced
4292:3fc808b0490b 4293:0c4bdb3d93fd
   351     """specific renderer for entity edition form (edition)"""
   351     """specific renderer for entity edition form (edition)"""
   352     __regid__ = 'default'
   352     __regid__ = 'default'
   353     # needs some additional points in some case (XXX explain cases)
   353     # needs some additional points in some case (XXX explain cases)
   354     __select__ = implements('Any') & yes()
   354     __select__ = implements('Any') & yes()
   355 
   355 
   356     _options = FormRenderer._options + ('display_relations_form', 'main_form_title')
   356     _options = FormRenderer._options + ('main_form_title',)
   357     display_relations_form = True
       
   358     main_form_title = _('main informations')
   357     main_form_title = _('main informations')
   359 
   358 
   360     def render(self, form, values):
   359     def render(self, form, values):
   361         rendered = super(EntityFormRenderer, self).render(form, values)
   360         rendered = super(EntityFormRenderer, self).render(form, values)
   362         return rendered + u'</div>' # close extra div introducted by open_form
   361         return rendered + u'</div>' # close extra div introducted by open_form
   370         return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values)
   369         return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values)
   371 
   370 
   372     def render_fields(self, w, form, values):
   371     def render_fields(self, w, form, values):
   373         super(EntityFormRenderer, self).render_fields(w, form, values)
   372         super(EntityFormRenderer, self).render_fields(w, form, values)
   374         self.inline_entities_form(w, form)
   373         self.inline_entities_form(w, form)
   375         if form.edited_entity.has_eid() and self.display_relations_form:
       
   376             self.relations_form(w, form)
       
   377 
   374 
   378     def _render_fields(self, fields, w, form):
   375     def _render_fields(self, fields, w, form):
   379         if not form.edited_entity.has_eid() or form.edited_entity.has_perm('update'):
   376         if not form.edited_entity.has_eid() or form.edited_entity.has_perm('update'):
   380             super(EntityFormRenderer, self)._render_fields(fields, w, form)
   377             super(EntityFormRenderer, self)._render_fields(fields, w, form)
   381 
   378