def to_dict(self): data = Previewable.to_dict(self) if self.project: data['project_id'] = int(self.project.id) data['project_name'] = str(self.project.name) data['project_title'] = str(self.project.title) else: data['project_id'] = None data['project_name'] = None data['project_title'] = None if self.template: data['template_id'] = int(self.template.id) data['template_name'] = str(self.template.name) data['template_title'] = str(self.template.title) else: data['template_id'] = None data['template_name'] = None data['template_title'] = None return data
def new_form_fields(cls): fields = Previewable.new_form_fields() fields['template_name'] = { 'fieldLabel' : 'Template Name' , 'value' : 'realtime_model' } fields['project_id'] = { 'fieldLabel' : 'Project' , 'xtype' : 'hidden' } return fields