hazelnut expects the initial columns to be passed to its constructor
[myslice.git] / trash / sliceview.py
index 6093ebf..d1c93dd 100644 (file)
@@ -29,33 +29,28 @@ def slice_view (request, slicename=tmp_default_slice):
     main_query = ManifoldQuery (action='get',
                                 subject='resource',
                                 timestamp='latest',
-                                fields=['hrn','hostname'],
+                                fields=['network','type','hrn','hostname'],
                                 filters= [ [ 'slice_hrn', '=', slicename, ] ],
-                                # xxx filter : should filter on the slices the logged user can see
-                                # we don't have the user's hrn yet
-                                # in addition this currently returns all slices anyways
-                                # filter = ...
-                                sort='slice_hrn',
                                 )
     page.enqueue_query (main_query)
 
     main_plugin = Stack (
         page=page,
-        title="global container",
+        title="Slice view for %s"%slicename,
         domid='thestack',
 #        togglable=False,
         sons=[Tabs (
                 page=page,
                 title="2 tabs : w/ and w/o checkboxes",
                 domid='thetabs',
-                toggled=False,
+#                toggled=False,
                 active_domid='checkboxes',
                 sons=[
                     Hazelnut ( 
                         page=page,
                         title='a sample and simple hazelnut',
                         domid='simple',
-#                        togglable=False,
+                        togglable=False,
                         # this is the query at the core of the slice list
                         query=main_query,
                         ),
@@ -63,7 +58,7 @@ def slice_view (request, slicename=tmp_default_slice):
                         page=page,
                         title='with checkboxes',
                         domid='checkboxes',
-#                        togglable=False,
+                        togglable=False,
                         checkboxes=True,
                         # this is the query at the core of the slice list
                         query=main_query,
@@ -73,22 +68,28 @@ def slice_view (request, slicename=tmp_default_slice):
                 page=page,
                 title='not in tabs',
                 domid='standalone',
-                toggled=False,
+#                toggled=False,
                 # this is the query at the core of the slice list
                 query=main_query,
+                columns=['hrn','hostname'],
                 ),
               QueryCode (
                 page=page,
                 title='xmlrpc code',
                 query=main_query,
-                toggled=False,
+#                toggled=False,
+                ),
+              QuickFilter (
+                page=page,
+                title="QuickFilter is currently the only one that requires metadata",
+                criterias=quickfilter_criterias
                 ),
               ])
 
-    # variables that will get passed to the view-unfold2.html template
+    # variables that will get passed to the view-unfold1.html template
     template_env = {}
     
-    # define 'unfold2_main' to the template engine
+    # define 'unfold1_main' to the template engine - the main contents
     template_env [ 'unfold1_main' ] = main_plugin.render(request)
 
     # more general variables expected in the template
@@ -98,23 +99,6 @@ def slice_view (request, slicename=tmp_default_slice):
     # so we can sho who is logged
     template_env [ 'username' ] = the_user (request) 
 
-### #   ########## add another plugin with the same request, on the RHS pane
-### #   will show up in the right-hand side area named 'related'
-###     related_plugin = SliceList (
-###         page=page,
-###         title='Same request, other layout',
-###         domid='sidelist',
-###         with_datatables=True, 
-###         header='paginated main',
-###         # share the query
-###         query=main_query,
-###         )
-###     # likewise but on the side view
-###     template_env [ 'unfold2_margin' ] = related_plugin.render (request)
-###     
-###     # add our own css in the mix
-###     page.add_css_files ( 'css/hazelnut.css')
-    
     # don't forget to run the requests
     page.exec_queue_asynchroneously ()
 
@@ -127,5 +111,4 @@ def slice_view (request, slicename=tmp_default_slice):
     template_env.update(prelude_env)
     result=render_to_response ('view-unfold1.html',template_env,
                                context_instance=RequestContext(request))
-    print 'result=',result
     return result