web/formfields.py
changeset 4395 e50b71c0dd87
parent 4393 87e48fe398f1
child 4443 83ff2bb898a5
equal deleted inserted replaced
4394:b98fbca17e9e 4395:e50b71c0dd87
   334                 new_value = self.process_form_value(form)
   334                 new_value = self.process_form_value(form)
   335             except ProcessFormError:
   335             except ProcessFormError:
   336                 return True
   336                 return True
   337             except UnmodifiedField:
   337             except UnmodifiedField:
   338                 return False
   338                 return False
   339             if form.edited_entity.has_eid() and previous_value == new_value:
   339             if previous_value == new_value:
   340                 return False # not modified
   340                 return False # not modified
   341             return True
   341             return True
   342         return False
   342         return False
   343 
   343 
   344     def process_form_value(self, form):
   344     def process_form_value(self, form):
   749         res.append((entity.view('combobox'), entity.eid))
   749         res.append((entity.view('combobox'), entity.eid))
   750     return res
   750     return res
   751 
   751 
   752 
   752 
   753 class RelationField(Field):
   753 class RelationField(Field):
       
   754     """the relation field to edit non final relations of an entity"""
   754 
   755 
   755     @staticmethod
   756     @staticmethod
   756     def fromcardinality(card, **kwargs):
   757     def fromcardinality(card, **kwargs):
   757         kwargs.setdefault('widget', fw.Select(multiple=card in '*+'))
   758         kwargs.setdefault('widget', fw.Select(multiple=card in '*+'))
   758         return RelationField(**kwargs)
   759         return RelationField(**kwargs)