Skip to content

Commit

Permalink
Allowing line breaks in fieldsets
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jan 6, 2016
1 parent ade9175 commit 3216fa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
11 changes: 6 additions & 5 deletions panoramix/forms.py
Expand Up @@ -438,11 +438,12 @@ class QueryForm(OmgWtForm):
TextField("Super", default=''))
for fieldset in viz.fieldsetizer():
for ff in fieldset['fields']:
if isinstance(ff, string_types):
ff = [ff]
for s in ff:
if s:
setattr(QueryForm, s, px_form_fields[s])
if ff:
if isinstance(ff, string_types):
ff = [ff]
for s in ff:
if s:
setattr(QueryForm, s, px_form_fields[s])


# datasource type specific form elements
Expand Down
4 changes: 3 additions & 1 deletion panoramix/templates/panoramix/explore.html
Expand Up @@ -69,7 +69,9 @@
{% endif %}
<div class="fieldset_content">
{% for fieldname in fieldset.fields %}
{% if not fieldname.__iter__ %}
{% if not fieldname %}
<hr/>
{% elif not fieldname.__iter__ %}
{{ panofield(fieldname) }}
{% else %}
<div class="row">
Expand Down
3 changes: 2 additions & 1 deletion panoramix/viz.py
Expand Up @@ -98,7 +98,7 @@ def flat_form_fields(cls):
for obj in d['fields']:
if isinstance(obj, (tuple, list)):
l |= {a for a in obj}
else:
elif obj:
l.add(obj)
return l

Expand Down Expand Up @@ -629,6 +629,7 @@ class NVD3TimeSeriesViz(NVD3Viz):
('rolling_type', 'rolling_periods'),
'time_compare',
'num_period_compare',
None,
('resample_how', 'resample_rule',), 'resample_fillmethod'
),
},
Expand Down

0 comments on commit 3216fa2

Please sign in to comment.