summaryrefslogtreecommitdiff
path: root/gstudio/views
diff options
context:
space:
mode:
authorKabir <kabir@gnowledge.org>2012-05-01 12:42:50 +0530
committerKabir <kabir@gnowledge.org>2012-05-01 12:42:50 +0530
commit9f8f3af43fe8ab6c3f3f5c4882ff4f325ee417b2 (patch)
tree2ad104d1669bc20e0bf80921cf7cab30519f4be9 /gstudio/views
parent80ae25b8ec38ba00eded83d7341dee851e77e838 (diff)
downloadgnowsys-9f8f3af43fe8ab6c3f3f5c4882ff4f325ee417b2.tar.gz
Relation filter modified to include OT, thier children, members of OTs and children.Creation, updation date removed from relation form
Diffstat (limited to 'gstudio/views')
-rw-r--r--gstudio/views/ajaxviews.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/gstudio/views/ajaxviews.py b/gstudio/views/ajaxviews.py
index 8fbb6e0..3991a89 100644
--- a/gstudio/views/ajaxviews.py
+++ b/gstudio/views/ajaxviews.py
@@ -76,22 +76,37 @@ def additemdict(sdict,itemtoadd):
sdict[itemtoadd.id]=itemtoadd.title
return sdict
def selectionlist_OT(obj):
+ # Basically the filter must filter out the OT, their members, the children and members of the children
+
global rlist
# Return all OTs and members of subtypes of OT
obs=Objecttype.objects.filter(title=obj)
# Get all members of subtypes of each OT
if obs:
+ # Add the items first
+ for each in obs:
+ rlist=additemdict(rlist,each)
obs=Objecttype.objects.get(title=obj)
+ # Add the objects first
+ # for each in obs:
+ # rlist = additemdict(rlist,each)
memobs=obs.get_members
if memobs:
for each in memobs:
rlist=additemdict(rlist,each)
childrenots=obs.get_children()
+ # Add children first
+ for each in childrenots:
+ rlist=additemdict(rlist,each)
+ # Add memebers of each child
if childrenots:
for eachchild in childrenots:
membs=eachchild.ref.get_members
for each in membs:
rlist=additemdict(rlist,each)
+
+
+
return rlist
def selectionlist_MT(obj):