web/views/forms.py
changeset 3369 7b88d12b4ee2
parent 3293 69c0ba095536
parent 3354 663bd041f17d
child 3377 dd9d292b6a6d
child 3388 b8be8fc77c27
equal deleted inserted replaced
3300:c7c4775a5619 3369:7b88d12b4ee2
    80         super(FieldsForm, self).__init__(req, rset=rset, row=row, col=col)
    80         super(FieldsForm, self).__init__(req, rset=rset, row=row, col=col)
    81         self.fields = list(self.__class__._fields_)
    81         self.fields = list(self.__class__._fields_)
    82         for key, val in kwargs.items():
    82         for key, val in kwargs.items():
    83             if key in NAV_FORM_PARAMETERS:
    83             if key in NAV_FORM_PARAMETERS:
    84                 self.form_add_hidden(key, val)
    84                 self.form_add_hidden(key, val)
    85             else:
    85             elif hasattr(self.__class__, key) and not key[0] == '_':
    86                 assert hasattr(self.__class__, key) and not key[0] == '_', key
       
    87                 setattr(self, key, val)
    86                 setattr(self, key, val)
       
    87             # skip other parameters, usually given for selection
       
    88             # (else write a custom class to handle them)
    88         if mainform:
    89         if mainform:
    89             self.form_add_hidden('__errorurl', self.session_key())
    90             self.form_add_hidden('__errorurl', self.session_key())
    90             self.form_add_hidden('__domid', self.domid)
    91             self.form_add_hidden('__domid', self.domid)
    91         if self.copy_nav_params:
    92         if self.copy_nav_params:
    92             for param in NAV_FORM_PARAMETERS:
    93             for param in NAV_FORM_PARAMETERS:
   528                                                 rsetsize, done)
   529                                                 rsetsize, done)
   529             if limit is not None and len(result) >= limit:
   530             if limit is not None and len(result) >= limit:
   530                 break
   531                 break
   531         return result
   532         return result
   532 
   533 
   533     def srelations_by_category(self, categories=None, permission=None):
   534     def srelations_by_category(self, categories=None, permission=None,
       
   535                                strict=False):
   534         return ()
   536         return ()
   535 
   537 
   536     def should_display_add_new_relation_link(self, rschema, existant, card):
   538     def should_display_add_new_relation_link(self, rschema, existant, card):
   537         return False
   539         return False
   538 
   540