web/views/forms.py
changeset 2144 51c84d585456
parent 2088 4ec37d33657e
parent 2089 b1070848726b
child 2293 7ded2a1416e4
equal deleted inserted replaced
2141:0072247db207 2144:51c84d585456
   265         super(EntityFieldsForm, self).__init__(*args, **kwargs)
   265         super(EntityFieldsForm, self).__init__(*args, **kwargs)
   266         if self.edited_entity is None:
   266         if self.edited_entity is None:
   267             self.edited_entity = self.complete_entity(self.row or 0, self.col or 0)
   267             self.edited_entity = self.complete_entity(self.row or 0, self.col or 0)
   268         self.form_add_hidden('__type', eidparam=True)
   268         self.form_add_hidden('__type', eidparam=True)
   269         self.form_add_hidden('eid')
   269         self.form_add_hidden('eid')
   270         if kwargs.get('mainform'):
   270         if kwargs.get('mainform', True): # mainform default to true in parent
   271             self.form_add_hidden(u'__maineid', self.edited_entity.eid)
   271             self.form_add_hidden(u'__maineid', self.edited_entity.eid)
   272             # If we need to directly attach the new object to another one
   272             # If we need to directly attach the new object to another one
   273             if self.req.list_form_param('__linkto'):
   273             if self.req.list_form_param('__linkto'):
   274                 for linkto in self.req.list_form_param('__linkto'):
   274                 for linkto in self.req.list_form_param('__linkto'):
   275                     self.form_add_hidden('__linkto', linkto)
   275                     self.form_add_hidden('__linkto', linkto)