Skip to content

Commit

Permalink
Minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Sep 21, 2015
1 parent e1b3c7e commit 4d1d3ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion panoramix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def refresh_datasources(self):


class Datasource(Model, AuditMixin, Queryable):
type = "datasource"
type = "druid"

baselink = "datasourcemodelview"

Expand Down
15 changes: 10 additions & 5 deletions panoramix/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ class ClusterModelView(ModelView, DeleteMixin):
class SliceModelView(ModelView, DeleteMixin):
datamodel = SQLAInterface(models.Slice)
can_add = False
list_columns = ['slice_link', 'viz_type', 'datasource', 'created_by']
list_columns = [
'slice_link', 'viz_type', 'datasource_type',
'datasource', 'created_by']
edit_columns = [
'slice_name', 'viz_type', 'druid_datasource', 'table',
'dashboards', 'params']
'slice_name', 'viz_type', 'druid_datasource',
'table', 'dashboards', 'params']
for p in range(1000):
print SliceModelView.list_columns

appbuilder.add_view(
SliceModelView,
Expand Down Expand Up @@ -227,10 +231,11 @@ def datasource(self, datasource_type, datasource_id):

table_id = druid_datasource_id = None
datasource_type = request.args.get('datasource_type')
if datasource_type == 'druid':
if datasource_type in ('datasource', 'druid'):
druid_datasource_id = request.args.get('datasource_id')
else:
elif datasource_type == 'table':
table_id = request.args.get('datasource_id')

slice_name = request.args.get('slice_name')

obj = models.Slice(
Expand Down
8 changes: 2 additions & 6 deletions panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class BigNumberViz(BaseViz):
js_files = ['d3.min.js']
form_fields = [
'viz_type',
'granularity', ('since', 'until'),
'granularity',
('since', 'until'),
'metric',
'compare_lag',
'compare_suffix',
Expand All @@ -238,11 +239,6 @@ def query_obj(self):
d['metrics'] = [self.args.get('metric')]
return d

def get_df(self):
args = self.args
self.df = super(BigNumberViz, self).get_df()
return self.df

def get_json(self):
args = self.args
df = self.get_df()
Expand Down

0 comments on commit 4d1d3ad

Please sign in to comment.