diff --git a/panoramix/forms.py b/panoramix/forms.py index cc29ecf64f1a2..f287f5ca03bf0 100644 --- a/panoramix/forms.py +++ b/panoramix/forms.py @@ -339,6 +339,7 @@ class QueryForm(OmgWtForm): slice_name = HiddenField() previous_viz_type = HiddenField(default=viz.viz_type) collapsed_fieldsets = HiddenField() + viz_type = self.field_dict.get('viz_type') filter_cols = datasource.filterable_column_names or [''] for i in range(10): @@ -361,6 +362,7 @@ class QueryForm(OmgWtForm): if s: setattr(QueryForm, s, px_form_fields[s]) + # datasource type specific form elements if datasource.__class__.__name__ == 'SqlaTable': QueryForm.fieldsets += ({ diff --git a/panoramix/migrations/versions/55179c7f25c7_sqla_descr.py b/panoramix/migrations/versions/55179c7f25c7_sqla_descr.py new file mode 100644 index 0000000000000..aade0b930aa0c --- /dev/null +++ b/panoramix/migrations/versions/55179c7f25c7_sqla_descr.py @@ -0,0 +1,22 @@ +"""sqla_descr + +Revision ID: 55179c7f25c7 +Revises: 315b3f4da9b0 +Create Date: 2015-12-13 08:38:43.704145 + +""" + +# revision identifiers, used by Alembic. +revision = '55179c7f25c7' +down_revision = '315b3f4da9b0' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('tables', sa.Column('description', sa.Text(), nullable=True)) + + +def downgrade(): + op.drop_column('tables', 'description') diff --git a/panoramix/models.py b/panoramix/models.py index f1547a34c7e44..73d060d30c958 100644 --- a/panoramix/models.py +++ b/panoramix/models.py @@ -225,6 +225,7 @@ class SqlaTable(Model, Queryable, AuditMixinNullable): id = Column(Integer, primary_key=True) table_name = Column(String(250), unique=True) main_dttm_col = Column(String(250)) + description = Column(Text) default_endpoint = Column(Text) database_id = Column(Integer, ForeignKey('dbs.id'), nullable=False) database = relationship( @@ -241,6 +242,9 @@ def perm(self): return ( "[{self.database}].[{self.table_name}]" "(id:{self.id})").format(self=self) + @property + def full_name(self): + return "[{self.database}].[{self.table_name}]".format(self=self) @property def dttm_cols(self): @@ -694,6 +698,10 @@ def perm(self): "[{self.cluster_name}].[{self.datasource_name}]" "(id:{self.id})").format(self=self) + @property + def full_name(self): + return "[{self.cluster_name}].[{self.datasource_name}]".format(self=self) + def __repr__(self): return self.datasource_name diff --git a/panoramix/static/panoramix.css b/panoramix/static/panoramix.css index bbdb22b9f17cc..8c4108fec0e84 100644 --- a/panoramix/static/panoramix.css +++ b/panoramix/static/panoramix.css @@ -10,6 +10,19 @@ form div { .navbar-brand a { color: white; } + +.notbtn { + cursor: default; +} + +span.title-block { + background-color: #EEE; + border-radius: 4px; + padding: 6px 12px; + margin: 0px 10px; + font-size: 20px; +} + fieldset.fs-style { font-family: Verdana, Arial, sans-serif; font-size: small; @@ -18,7 +31,7 @@ fieldset.fs-style { background-color: #F4F4F4; border-radius: 6px; padding: 10px; - margin: 10px 0px; + margin: 0px 0px 10px 0px; } legend.legend-style { font-size: 14px; diff --git a/panoramix/templates/panoramix/explore.html b/panoramix/templates/panoramix/explore.html index e3dd9589b152e..811597e6e2f35 100644 --- a/panoramix/templates/panoramix/explore.html +++ b/panoramix/templates/panoramix/explore.html @@ -2,26 +2,44 @@ {% block content_fluid %} {% set datasource = viz.datasource %} {% set form = viz.form %} + +{% macro panofield(fieldname)%} +