Ejemplo n.º 1
0
 def new(self, dataset, errors={}):
     self._get_dataset(dataset)
     self._disable_cache()
     handle_request(request, c, c.dataset)
     c.widgets = dict([(n, widgets.get_widget(n)) \
         for n in widgets.list_widgets()])
     if 'dev_widget' in request.params and \
         request.params.get('dev_widget') not in widgets.list_widgets():
         n = request.params.get('dev_widget')
         c.widgets[n] = widgets.get_widget(n, force=True)
     c.errors = errors
     c.can_save = can.view.create(c.dataset)
     return render('view/new.html')
Ejemplo n.º 2
0
 def new(self, dataset, errors={}):
     self._get_dataset(dataset)
     self._disable_cache()
     handle_request(request, c, c.dataset)
     c.widgets = dict([(n, widgets.get_widget(n)) \
         for n in widgets.list_widgets()])
     if 'dev_widget' in request.params and \
         request.params.get('dev_widget') not in widgets.list_widgets():
         n = request.params.get('dev_widget')
         c.widgets[n] = widgets.get_widget(n, force=True)
     c.errors = errors
     c.can_save = can.view.create(c.dataset)
     return templating.render('view/new.html')
Ejemplo n.º 3
0
 def view(self, dataset, name, format='html'):
     self._get_named_view(dataset, name)
     handle_request(request, c, c.dataset)
     c.widget = widgets.get_widget(c.named_view.widget)
     if format == 'json':
         return to_jsonp(c.named_view.as_dict())
     else:
         return render('view/view.html')
Ejemplo n.º 4
0
 def view(self, dataset, dimension, format='html'):
     self._get_dimension(dataset, dimension)
     if format == 'json':
         dimension = dimension_apply_links(dataset, c.dimension.as_dict())
         return to_jsonp(dimension)
     c.widget = get_widget('aggregate_table')
     c.widget_state = {'drilldowns': [c.dimension.name]}
     return render('dimension/view.html')
Ejemplo n.º 5
0
 def view(self, dataset, name, format='html'):
     self._get_named_view(dataset, name)
     handle_request(request, c, c.dataset)
     c.widget = widgets.get_widget(c.named_view.widget)
     if format == 'json':
         return to_jsonp(c.named_view.as_dict())
     else:
         return templating.render('view/view.html')
Ejemplo n.º 6
0
 def new(self, dataset, errors={}):
     self._get_dataset(dataset)
     handle_request(request, c, c.dataset)
     c.widgets = dict([(n, widgets.get_widget(n)) \
         for n in widgets.list_widgets()])
     c.errors = errors
     c.can_save = can.view.create(c.dataset)
     return render('view/new.html')
Ejemplo n.º 7
0
 def view(self, dataset, dimension, format='html'):
     self._get_dimension(dataset, dimension)
     etag_cache_keygen(c.dataset.updated_at, format)
     if format == 'json':
         dimension = dimension_apply_links(dataset, c.dimension.as_dict())
         return to_jsonp(dimension)
     c.widget = get_widget('aggregate_table')
     c.widget_state = {'drilldowns': [c.dimension.name]}
     return templating.render('dimension/view.html')
Ejemplo n.º 8
0
 def view(self, dataset, dimension, format='html'):
     self._get_dimension(dataset, dimension)
     etag_cache_keygen(c.dataset.updated_at, format)
     if format == 'json':
         dimension = dimension_apply_links(dataset, c.dimension.as_dict())
         return to_jsonp(dimension)
     c.widget = get_widget('aggregate_table')
     c.widget_state = {'drilldowns': [c.dimension.name]}
     return templating.render('dimension/view.html')
Ejemplo n.º 9
0
 def view(self, dataset, dimension, format="html"):
     self._get_dimension(dataset, dimension)
     etag_cache_keygen(c.dataset.updated_at, format)
     if format == "json":
         dimension = dimension_apply_links(dataset, c.dimension.as_dict())
         return to_jsonp(dimension)
     c.widget = get_widget("aggregate_table")
     c.widget_state = {"drilldowns": [c.dimension.name]}
     return templating.render("dimension/view.html")
Ejemplo n.º 10
0
 def embed(self, dataset):
     self._get_dataset(dataset)
     c.widget = request.params.get('widget')
     if c.widget is None:
         abort(400, _("No widget type has been specified."))
     try:
         c.widget = widgets.get_widget(c.widget)
         c.state = json.loads(request.params.get('state', '{}'))
     except ValueError as ve:
         abort(400, unicode(ve))
     return render('view/embed.html')
Ejemplo n.º 11
0
 def embed(self, dataset):
     self._get_dataset(dataset)
     c.widget = request.params.get('widget')
     if c.widget is None:
         abort(400, _("No widget type has been specified."))
     try:
         c.widget = widgets.get_widget(c.widget)
         c.state = json.loads(request.params.get('state', '{}'))
     except ValueError as ve:
         abort(400, unicode(ve))
     return templating.render('view/embed.html')
Ejemplo n.º 12
0
 def vis_widget(self):
     return widgets.get_widget('treemap')
Ejemplo n.º 13
0
 def table_widget(self):
     return widgets.get_widget('aggregate_table')
Ejemplo n.º 14
0
 def vis_widget(self):
     return widgets.get_widget('treemap')
Ejemplo n.º 15
0
 def table_widget(self):
     return widgets.get_widget('aggregate_table')