src/p4l/views.py
changeset 99 0d54489e8b26
parent 93 c675183a9325
child 113 c05567404888
--- a/src/p4l/views.py	Wed Sep 18 15:51:57 2013 +0200
+++ b/src/p4l/views.py	Wed Sep 18 16:49:58 2013 +0200
@@ -96,6 +96,11 @@
             uri_list = [self.object.recordType]
             uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/DocumentType", lang, False)
             context['recordType_label'] = uris_labels[self.object.recordType]
+        # Here, in the future, there will be the request for audiences thesaurus
+        context['audiences_labels'] = {}
+        #uri_list = [s.uri for s in self.object.audiences.all()]
+        #uris_labels = get_labels_for_uris(uri_list, "http://www.iiep.unesco.org/plan4learning/scheme/Audiences", lang, False)
+        #context['audiences_labels'] = uris_labels
         
         return context
 
@@ -176,6 +181,13 @@
                 'datarootquery': settings.SPARQL_TYPE_QUERIES["root"] % lang,
                 'datachildsquery': "",
                 'datachildcountquery': ""
+            },
+            'audiences': {
+                'dataurl': settings.SPARQL_QUERY_ENDPOINT,
+                'dataquery': settings.SPARQL_AUDIENCE_QUERIES["filter"],
+                'datarootquery': settings.SPARQL_AUDIENCE_QUERIES["root"],
+                'datachildsquery': settings.SPARQL_AUDIENCE_QUERIES["childs"],
+                'datachildcountquery': settings.SPARQL_AUDIENCE_QUERIES["child-count"]
             }
         }
         context['query_dicts'] = json.dumps(query_dicts)