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) |