Exemple #1
0
 def make_json(self, uuid):
     """ makes JSON for the profile item """
     ok = self.check_exists(uuid)
     if ok:
         # makes mandatory fields if they don't exist
         mip = ManageInputProfile()
         mip.make_mandatory_fields(self.project_uuid, self.inp_prof.uuid,
                                   self.inp_prof.item_type)
         profile = LastUpdatedOrderedDict()
         profile['id'] = self.uuid
         profile['label'] = self.inp_prof.label
         profile['note'] = self.inp_prof.note
         profile['updated'] = self.inp_prof.updated.date().isoformat()
         profile['item_type'] = self.inp_prof.item_type
         profile['project'] = LastUpdatedOrderedDict()
         profile['project']['uuid'] = self.project.uuid
         profile['project']['label'] = self.project.label
         profile['fgroups'] = self.get_field_groups_and_fields()
     else:
         profile = False
     return profile
 def make_json(self, uuid):
     """ makes JSON for the profile item """
     ok = self.check_exists(uuid)
     if ok:
         # makes mandatory fields if they don't exist
         mip = ManageInputProfile()
         mip.make_mandatory_fields(self.project_uuid,
                                   self.inp_prof.uuid,
                                   self.inp_prof.item_type)
         profile = LastUpdatedOrderedDict()
         profile['id'] = self.uuid
         profile['label'] = self.inp_prof.label
         profile['note'] = self.inp_prof.note
         profile['updated'] = self.inp_prof.updated.date().isoformat()
         profile['item_type'] = self.inp_prof.item_type
         profile['project'] = LastUpdatedOrderedDict()
         profile['project']['uuid'] = self.project.uuid
         profile['project']['label'] = self.project.label
         profile['fgroups'] = self.get_field_groups_and_fields()
     else:
         profile = False
     return profile