# HG changeset patch # User rougeronj # Date 1422616478 -3600 # Node ID deb24a52827f61e49f10ef9c3182abeaf39aec6f # Parent 0116feeb4fa3ec9dfe113e39f29edf22514e15ec Close #26 - show link between a notice and a ressource diff -r 0116feeb4fa3 -r deb24a52827f src/hdalab/views/profile.py --- a/src/hdalab/views/profile.py Thu Jan 29 17:23:04 2015 +0100 +++ b/src/hdalab/views/profile.py Fri Jan 30 12:14:38 2015 +0100 @@ -250,6 +250,7 @@ #"created_by": "roster_user-84fe909f-ba37-48e6-a25f-9d2f129a95b7", "shape": shapes["notice"] }) + notice_id = content["nodes"][0]["id"] # Get translated labels translations = {} @@ -276,6 +277,20 @@ #"created_by": "roster_user-84fe909f-ba37-48e6-a25f-9d2f129a95b7", "shape": shapes["tag2"] }) + + # Place edges + for node in content["nodes"]: + content["edges"].append({ + "id": unicode(uuid.uuid1()), + "title": "", + "description": "", + "uri": "", + "color": None, + "from": notice_id, + "to": node["id"], + "project_id": project_id, + #"created_by": "de68xf75y6hs5rgjhgghxbm217xk" + }) response = json.dumps(content) return HttpResponse(response, content_type="application/json")