diff options
author | Kabir <kabir@gnowledge.org> | 2012-05-03 21:22:07 +0530 |
---|---|---|
committer | Kabir <kabir@gnowledge.org> | 2012-05-03 21:22:07 +0530 |
commit | cff95e555ab81fd93284effe6dc2995f9dc1af3a (patch) | |
tree | a91cf984bc030b6cc9a6005c43be81b5b66c3d77 /gstudio/views | |
parent | 4f6879034e2103658a6099c1572efb67712bff1f (diff) | |
download | gnowsys-cff95e555ab81fd93284effe6dc2995f9dc1af3a.tar.gz |
the js file of gstudio is now called from gstudio.Filler modified to include chilren and members of the childern of subjecttypes
Diffstat (limited to 'gstudio/views')
-rw-r--r-- | gstudio/views/ajaxviews.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gstudio/views/ajaxviews.py b/gstudio/views/ajaxviews.py index 3991a89..23c06e5 100644 --- a/gstudio/views/ajaxviews.py +++ b/gstudio/views/ajaxviews.py @@ -27,10 +27,19 @@ def AjaxAttribute(request): subjecttype = attr.subjecttype returndict = {} - for each in Objecttype.objects.all(): - if attr.subjecttype.id == each.id: - for member in each.get_members: + for ots in Objecttype.objects.all(): + if attr.subjecttype.id ==ots.id: + for member in ots.get_members: returndict[member.id] = member.title + childrenots = ots.get_children() + + if childrenots: + for eachchild in childrenots: + returndict[eachchild.id] = eachchild.title + membs=eachchild.ref.get_members + for each in membs: + returndict[each.id] = each.title + jsonobject = json.dumps(returndict) return HttpResponse(jsonobject, "application/json") |