Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Aug 11, 2015
1 parent 221b86b commit 3a0eb07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
14 changes: 8 additions & 6 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ def filterable_column_names(self):
class Database(Model, AuditMixin):
__tablename__ = 'dbs'
id = Column(Integer, primary_key=True)
database_name = Column(String(256), unique=True)
database_name = Column(String(255), unique=True)
sqlalchemy_uri = Column(String(1024))

baselink = "datasourcemodelview"

def __repr__(self):
return self.database_name
Expand All @@ -60,7 +59,7 @@ def get_table(self, table_name):
class Table(Model, Queryable, AuditMixin):
__tablename__ = 'tables'
id = Column(Integer, primary_key=True)
table_name = Column(String(256), unique=True)
table_name = Column(String(255), unique=True)
main_datetime_column_id = Column(Integer, ForeignKey('table_columns.id'))
main_datetime_column = relationship(
'TableColumn', foreign_keys=[main_datetime_column_id])
Expand Down Expand Up @@ -234,7 +233,7 @@ def __repr__(self):
class Cluster(Model, AuditMixin):
__tablename__ = 'clusters'
id = Column(Integer, primary_key=True)
cluster_name = Column(String(256), unique=True)
cluster_name = Column(String(255), unique=True)
coordinator_host = Column(String(256))
coordinator_port = Column(Integer)
coordinator_endpoint = Column(String(256))
Expand Down Expand Up @@ -263,16 +262,19 @@ def refresh_datasources(self):


class Datasource(Model, AuditMixin, Queryable):

baselink = "datasourcemodelview"

__tablename__ = 'datasources'
id = Column(Integer, primary_key=True)
datasource_name = Column(String(256), unique=True)
datasource_name = Column(String(255), unique=True)
is_featured = Column(Boolean, default=False)
is_hidden = Column(Boolean, default=False)
description = Column(Text)
default_endpoint = Column(Text)
user_id = Column(Integer, ForeignKey('ab_user.id'))
owner = relationship('User', backref='datasources', foreign_keys=[user_id])
cluster_name = Column(String(256),
cluster_name = Column(String(255),
ForeignKey('clusters.cluster_name'))
cluster = relationship('Cluster', backref='datasources', foreign_keys=[cluster_name])

Expand Down
7 changes: 2 additions & 5 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ class TableColumnInlineView(CompactCRUDMixin, ModelView):
'column_name', 'description', 'table', 'groupby', 'filterable',
'count_distinct', 'sum', 'min', 'max']
list_columns = [
'column_name', 'type', 'groupby', 'count_distinct',
'column_name', 'type', 'groupby', 'filterable', 'count_distinct',
'sum', 'min', 'max']
page_size = 100
list_columns = [
'column_name', 'type', 'groupby', 'count_distinct',
'sum', 'min', 'max']
appbuilder.add_view_no_menu(TableColumnInlineView)


Expand All @@ -49,7 +46,7 @@ class ColumnInlineView(CompactCRUDMixin, ModelView):
'column_name', 'description', 'datasource', 'groupby',
'count_distinct', 'sum', 'min', 'max']
list_columns = [
'column_name', 'type', 'groupby', 'count_distinct',
'column_name', 'type', 'groupby', 'filterable', 'count_distinct',
'sum', 'min', 'max']
can_delete = False
page_size = 100
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
flask
flask-alembic
flask-appbuilder
mysql-python
pandas
parsedatetime
pydruid
pyhive
python-dateutil
requests

0 comments on commit 3a0eb07

Please sign in to comment.