Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 21, 2016
1 parent 4f9d973 commit 879a154
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions caravel/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ def add_to_form(attrs):
for attr in attrs:
setattr(QueryForm, attr, self.field_dict[attr])


filter_choices = self.choicify(['in', 'not in'])
# datasource type specific form elements
if viz.datasource.__class__.__name__ == 'SqlaTable':
Expand All @@ -663,8 +662,6 @@ def add_to_form(attrs):
add_to_form(('where', 'having'))
grains = viz.datasource.database.grains()

if not viz.datasource.any_dttm_col:
return QueryForm
if grains:
time_fields = ('granularity_sqla', 'time_grain_sqla')
self.field_dict['time_grain_sqla'] = SelectField(
Expand Down Expand Up @@ -705,12 +702,13 @@ def add_to_form(attrs):
QueryForm, 'flt_eq_' + str(i),
TextField("Super", default=''))

QueryForm.fieldsets = ({
'label': 'Time',
'fields': (
time_fields,
('since', 'until'),
),
'description': "Time related form attributes",
},) + tuple(QueryForm.fieldsets)
if viz.datasource.any_dttm_col:
QueryForm.fieldsets = ({
'label': 'Time',
'fields': (
time_fields,
('since', 'until'),
),
'description': "Time related form attributes",
},) + tuple(QueryForm.fieldsets)
return QueryForm

0 comments on commit 879a154

Please sign in to comment.