Dodanie MySQL-python do requirements.txt.
[redakcja.git] / apps / api / handlers / toolbar_handlers.py
index be77359..09a7085 100644 (file)
@@ -1,5 +1,8 @@
 # -*- encoding: utf-8 -*-
 
+import logging
+log = logging.getLogger('platforma.api.toolbar')
+
 __author__= "Ɓukasz Rekucki"
 __date__ = "$2009-09-25 15:55:33$"
 __doc__ = "Module documentation."
@@ -17,9 +20,7 @@ class ToolbarHandler(BaseHandler):
 
     def read(self, request):
         groups = toolbar.models.ButtonGroup.objects.all()
-        return [ {'name': g.name, 'position': g.position,\
-            'buttons': g.button_set.all()} for g in groups ]
-            
+        return [g.to_dict(with_buttons=True) for g in groups]
             
 class ScriptletsHandler(BaseHandler):
     allowed_methods = ('GET',)