web/views/baseforms.py
branchtls-sprint
changeset 1275 441201a5c13f
parent 1181 620ec8e6ae19
child 1289 5eff2ef92977
equal deleted inserted replaced
1274:b730932a79b7 1275:441201a5c13f
   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, rschema, role, targettype)
   330         return AutomaticEntityForm.rinlined.etype_rtag(entity.id, rschema, role,
       
   331                                                        targettype)
   331 
   332 
   332     def should_display_inline_relation_form(self, rschema, existant, card):
   333     def should_display_inline_relation_form(self, rschema, existant, card):
   333         return not existant and card in '1+'
   334         return not existant and card in '1+'
   334 
   335 
   335     def should_display_add_inline_relation_link(self, rschema, existant, card):
   336     def should_display_add_inline_relation_link(self, rschema, existant, card):
   427         super(InlineFormMixIn, self).edit_form(entity, kwargs)
   428         super(InlineFormMixIn, self).edit_form(entity, kwargs)
   428     
   429     
   429     def should_inline_relation_form(self, entity, rschema, targettype, role):
   430     def should_inline_relation_form(self, entity, rschema, targettype, role):
   430         if rschema == self.rschema:
   431         if rschema == self.rschema:
   431             return False
   432             return False
   432         return AutomaticForm.rinlined.etype_rtag(entity.id, rschema, role, targettype)
   433         return AutomaticEntityForm.rinlined.etype_rtag(entity.id, rschema, role,
       
   434                                                        targettype)
   433 
   435 
   434     @cached
   436     @cached
   435     def keep_entity(self, entity):
   437     def keep_entity(self, entity):
   436         req = self.req
   438         req = self.req
   437         # are we regenerating form because of a validation error ?
   439         # are we regenerating form because of a validation error ?