web/views/baseforms.py
branchtls-sprint
changeset 1181 620ec8e6ae19
parent 1154 9b23a6836c32
child 1275 441201a5c13f
equal deleted inserted replaced
1180:5536d4ee2bc3 1181:620ec8e6ae19
   325         return '\n'.join(result)
   325         return '\n'.join(result)
   326 
   326 
   327     # should_* method extracted to allow overriding
   327     # should_* method extracted to allow overriding
   328     
   328     
   329     def should_inline_relation_form(self, entity, rschema, targettype, role):
   329     def should_inline_relation_form(self, entity, rschema, targettype, role):
   330         return AutomaticForm.rinlined.etype_rtag(entity.id, role, rschema, targettype)
   330         return AutomaticForm.rinlined.etype_rtag(entity.id, rschema, role, targettype)
   331 
   331 
   332     def should_display_inline_relation_form(self, rschema, existant, card):
   332     def should_display_inline_relation_form(self, rschema, existant, card):
   333         return not existant and card in '1+'
   333         return not existant and card in '1+'
   334 
   334 
   335     def should_display_add_inline_relation_link(self, rschema, existant, card):
   335     def should_display_add_inline_relation_link(self, rschema, existant, card):
   427         super(InlineFormMixIn, self).edit_form(entity, kwargs)
   427         super(InlineFormMixIn, self).edit_form(entity, kwargs)
   428     
   428     
   429     def should_inline_relation_form(self, entity, rschema, targettype, role):
   429     def should_inline_relation_form(self, entity, rschema, targettype, role):
   430         if rschema == self.rschema:
   430         if rschema == self.rschema:
   431             return False
   431             return False
   432         return AutomaticForm.rinlined.etype_rtag(entity.id, role, rschema, targettype)
   432         return AutomaticForm.rinlined.etype_rtag(entity.id, rschema, role, targettype)
   433 
   433 
   434     @cached
   434     @cached
   435     def keep_entity(self, entity):
   435     def keep_entity(self, entity):
   436         req = self.req
   436         req = self.req
   437         # are we regenerating form because of a validation error ?
   437         # are we regenerating form because of a validation error ?