Exemple #1
0
def view_concept(request, uid):
    concept = Concept.get(uid)[0]

    # For each measured by (contrast), get the task
    if "MEASUREDBY" in concept["relations"]:
        for c in range(len(concept["relations"]["MEASUREDBY"])):
            contrast = concept["relations"]["MEASUREDBY"][c]
            tasks = Contrast.get_tasks(contrast["id"])
            concept["relations"]["MEASUREDBY"][c]["tasks"] = tasks

    context = {"concept": concept}

    return render(request, 'atlas/view_concept.html', context)
Exemple #2
0
 def test_contrast_get_tasks(self):
     contrast = Contrast()
     tasks = contrast.get_tasks(self.cont.properties['id'])
     self.assertEqual(len(tasks), 1)
     self.assertEqual(tasks[0]['task_id'], self.task1.properties['id'])