1 # Create your views here.
3 from django.core.context_processors import csrf
4 from django.template import RequestContext
5 from django.template.loader import render_to_string
6 from django.shortcuts import render_to_response
8 from django.contrib.auth.decorators import login_required
10 from unfold.page import Page
11 from manifold.manifoldquery import ManifoldQuery
13 from plugins.stack.stack import Stack
14 from plugins.tabs.tabs import Tabs
15 from plugins.lists.staticlist import StaticList
16 from plugins.quickfilter.quickfilter import QuickFilter
17 from plugins.raw.raw import Raw
18 from plugins.messages.messages import Messages
19 from plugins.updater.updater import Updater
21 from myslice.viewutils import topmenu_items, the_user
22 from myslice.viewutils import hard_wired_slice_names, hard_wired_list, lorem_p, lorem, quickfilter_criterias
25 def test_plugin_view (request):
29 # variables that will get passed to this template
32 slicename='ple.inria.omftest'
33 main_query = ManifoldQuery (action='get',
36 fields=['network','type','hrn','hostname'],
37 filters= [ [ 'slice_hrn', '=', slicename, ] ],
48 title="Runtime messages",
59 # define 'unfold1_main' to the template engine
60 template_env [ 'unfold1_main' ] = main_plugin.render(request)
62 # more general variables expected in the template
63 template_env [ 'title' ] = 'Single Plugin View'
64 template_env [ 'topmenu_items' ] = topmenu_items('plugin', request)
65 template_env [ 'username' ] = the_user (request)
67 # we don't have anythong asynchroneous, and manifold.js is not loaded
68 # page.exec_queue_asynchroneously ()
70 # the prelude object in page contains a summary of the requirements() for all plugins
71 # define {js,css}_{files,chunks}
72 prelude_env = page.prelude_env()
73 template_env.update(prelude_env)
74 return render_to_response ('view-unfold1.html',template_env,
75 context_instance=RequestContext(request))