web/views/autoform.py
changeset 5590 a56eb02f9ce7
parent 5557 1a534c596bff
parent 5588 377c9adfe81e
child 5594 fe7d84363d23
equal deleted inserted replaced
5578:6b9fee0c5c42 5590:a56eb02f9ce7
   641     # for attributes selection when searching in uicfg.autoform_section
   641     # for attributes selection when searching in uicfg.autoform_section
   642     formtype = 'main'
   642     formtype = 'main'
   643     # set this to a list of [(relation, role)] if you want to explictily tell
   643     # set this to a list of [(relation, role)] if you want to explictily tell
   644     # which relations should be edited
   644     # which relations should be edited
   645     display_fields = None
   645     display_fields = None
       
   646     # action on the form tag
       
   647     _default_form_action_path = 'validateform'
   646 
   648 
   647     @iclassmethod
   649     @iclassmethod
   648     def field_by_name(cls_or_self, name, role=None, eschema=None):
   650     def field_by_name(cls_or_self, name, role=None, eschema=None):
   649         """return field with the given name and role. If field is not explicitly
   651         """return field with the given name and role. If field is not explicitly
   650         defined for the form but `eclass` is specified, guess_field will be
   652         defined for the form but `eclass` is specified, guess_field will be
   711     def related_limit(self):
   713     def related_limit(self):
   712         if self.force_display:
   714         if self.force_display:
   713             return None
   715             return None
   714         return self.maxrelitems + 1
   716         return self.maxrelitems + 1
   715 
   717 
   716     def action(self):
       
   717         """return the form's action attribute. Default to validateform if not
       
   718         explicitly overriden.
       
   719         """
       
   720         try:
       
   721             return self._action
       
   722         except AttributeError:
       
   723             return self._cw.build_url('validateform')
       
   724 
       
   725     def set_action(self, value):
       
   726         """override default action"""
       
   727         self._action = value
       
   728 
       
   729     action = property(action, set_action)
       
   730 
       
   731     # autoform specific fields #################################################
   718     # autoform specific fields #################################################
   732 
   719 
   733     def _generic_relations_field(self):
   720     def _generic_relations_field(self):
   734         try:
   721         try:
   735             srels_by_cat = self.srelations_by_category('generic', 'add', strict=True)
   722             srels_by_cat = self.srelations_by_category('generic', 'add', strict=True)