summaryrefslogtreecommitdiff
path: root/gstudio
diff options
context:
space:
mode:
Diffstat (limited to 'gstudio')
-rw-r--r--gstudio/admin/relation.py2
-rw-r--r--gstudio/views/ajaxviews.py15
2 files changed, 16 insertions, 1 deletions
diff --git a/gstudio/admin/relation.py b/gstudio/admin/relation.py
index 3d2f2e4d..8f112ef4 100644
--- a/gstudio/admin/relation.py
+++ b/gstudio/admin/relation.py
@@ -8,7 +8,7 @@ import reversion
from django.template.defaultfilters import slugify
class RelationAdmin(reversion.VersionAdmin):
- fieldsets=((_('Relation'),{'fields': ('relationtype','relationtype_scope','left_subject' ,'left_subject_scope','right_subject','right_subject_scope','last_update','creation_date')}),
+ fieldsets=((_('Relation'),{'fields': ('relationtype','relationtype_scope','left_subject' ,'left_subject_scope','right_subject','right_subject_scope')}),
)
diff --git a/gstudio/views/ajaxviews.py b/gstudio/views/ajaxviews.py
index 8fbb6e03..3991a899 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):