diff --git a/panoramix/migrations/versions/b4a0abe21630_post_aggs.py b/panoramix/migrations/versions/b4a0abe21630_post_aggs.py new file mode 100644 index 0000000000..b913323b2a --- /dev/null +++ b/panoramix/migrations/versions/b4a0abe21630_post_aggs.py @@ -0,0 +1,32 @@ +"""post_aggs + +Revision ID: b4a0abe21630 +Revises: 430039611635 +Create Date: 2016-02-10 15:16:58.953042 + +""" + +# revision identifiers, used by Alembic. +revision = 'b4a0abe21630' +down_revision = '430039611635' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + + +def upgrade(): + op.create_table('post_aggregators', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(length=512), nullable=True), + sa.Column('verbose_name', sa.String(length=1024), nullable=True), + sa.Column('datasource_name', sa.String(length=250), nullable=True), + sa.Column('json', sa.Text(), nullable=True), + sa.Column('description', sa.Text(), nullable=True), + sa.ForeignKeyConstraint(['datasource_name'], ['datasources.datasource_name'], ), + sa.PrimaryKeyConstraint('id') + ) + + +def downgrade(): + op.drop_table('post_aggregators') diff --git a/panoramix/models.py b/panoramix/models.py index 93657f9c78..c341d79871 100644 --- a/panoramix/models.py +++ b/panoramix/models.py @@ -1170,3 +1170,16 @@ class DruidColumn(Model, AuditMixinNullable): if not m: session.add(metric) session.commit() + + +class DruidPostAggregator(Model): + __tablename__ = 'post_aggregators' + id = Column(Integer, primary_key=True) + name = Column(String(512)) + verbose_name = Column(String(1024)) + datasource_name = Column( + String(250), + ForeignKey('datasources.datasource_name')) + datasource = relationship('DruidDatasource', backref='post_aggregators') + json = Column(Text) + description = Column(Text) diff --git a/panoramix/static/widgets/viz_helloworld.js b/panoramix/static/widgets/viz_helloworld.js new file mode 100644 index 0000000000..142054927e --- /dev/null +++ b/panoramix/static/widgets/viz_helloworld.js @@ -0,0 +1,19 @@ +px.registerViz('helloworld', function(slice) { + + function refresh() { + $('#code').attr('rows', '15') + $.getJSON(slice.jsonEndpoint(), function(payload) { + slice.container.html( + '