if debug: print methodName, self.auth, self.url,'->',result
return result
return func
+
+ # 4amine : xxx
+ def send_manifold_query (self, manifold_query):
+ (action,method)= (raw_query.action,raw_query.method)
+ if action=='get':
+ return self.Get(method,
+ # need to fill in the other args here
+ )
+ # xxx...
+ elif action=='others':
+ return None
+
+
#from django.core import serializers
from django.http import HttpResponse, HttpResponseForbidden
+from engine.manifoldquery import ManifoldQuery
+
# xxx should probably cater for
# format_in : how is the query encoded in POST
# format_out: how to serve the results
return
# xxx actually ask the backend here
+ # 4amine
+ # manifold_query = ManifoldQuery()
+ # manifold_query.fill_from_dict(request.POST)
+ # locate the api and/or the auth
+ # api=
+ # forward
+ # answer=api.send_manifold_query (manifold_query)
hard_wired_answer = [ {'slice_hrn':'a.b.c'}, {'slice_hrn':'ple.inria.foo' } ]
answer=hard_wired_answer
return HttpResponse (json.dumps(answer), mimetype="application/json")
sq="{%s}"%sq
return """ new Query('%(a)s', '%(m)s', '%(t)s', %(f)s, %(p)s, %(c)s, %(unique)s, '%(uuid)s', %(aq)s, %(sq)s)"""%locals()
+
+ # 4amine
+ # xxx
+ # this should build an object from a dict as received from javascript
+ # to see an example just look at the server's output
+ # incoming POST <QueryDict: {u'query[method]': [u'slice'], u'query[fields][]': [u'slice_hrn'], u'query[ts]': [u'latest'], u'query[action]': [u'get']}>
+ def fill_from_dict (self, d):
+ # mandatory...
+ self.action=d['action']
+ self.method=d['method']
+ #
main_plugin = SimpleList ( # setting visible attributes first
pluginset=pluginset,
- title='SimpleList and dataTables',
+ title='Asynchroneous SimpleList',
header='slices list',
with_datatables=True,
toggled=False,
# template_env [ 'content_related' ] = related_plugin.render (request)
# more general variables expected in the template
- template_env [ 'title' ] = 'SimpleList Test View'
+ template_env [ 'title' ] = 'Test view for a full request cycle'
# the menu items on the top
template_env [ 'topmenu_items' ] = topmenu_items('dashboard', request)
# so we can sho who is logged