web/views/autoform.py
branchstable
changeset 7063 b07ee816bffb
parent 6725 6e6d1d19f341
child 7411 238da9684f99
equal deleted inserted replaced
7060:f26a1cbddc91 7063:b07ee816bffb
   783             self.edited_entity, self.formtype, section, permission, strict)
   783             self.edited_entity, self.formtype, section, permission, strict)
   784 
   784 
   785     def editable_attributes(self, strict=False):
   785     def editable_attributes(self, strict=False):
   786         """return a list of (relation schema, role) to edit for the entity"""
   786         """return a list of (relation schema, role) to edit for the entity"""
   787         if self.display_fields is not None:
   787         if self.display_fields is not None:
   788             return self.display_fields
   788             schema = self._cw.vreg.schema
       
   789             return [(schema[rtype], role) for rtype, role in self.display_fields]
   789         if self.edited_entity.has_eid() and not self.edited_entity.cw_has_perm('update'):
   790         if self.edited_entity.has_eid() and not self.edited_entity.cw_has_perm('update'):
   790             return []
   791             return []
   791         # XXX we should simply put eid in the generated section, no?
   792         # XXX we should simply put eid in the generated section, no?
   792         return [(rtype, role) for rtype, _, role in self._relations_by_section(
   793         return [(rtype, role) for rtype, _, role in self._relations_by_section(
   793             'attributes', 'update', strict)]
   794             'attributes', 'update', strict)]