예제 #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)
예제 #2
0
파일: test_query.py 프로젝트: rwblair/cogat
 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'])