本文整理汇总了Python中plenario.models.ShapeMetadata.get_all_with_etl_status方法的典型用法代码示例。如果您正苦于以下问题:Python ShapeMetadata.get_all_with_etl_status方法的具体用法?Python ShapeMetadata.get_all_with_etl_status怎么用?Python ShapeMetadata.get_all_with_etl_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plenario.models.ShapeMetadata
的用法示例。
在下文中一共展示了ShapeMetadata.get_all_with_etl_status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: view_datasets
# 需要导入模块: from plenario.models import ShapeMetadata [as 别名]
# 或者: from plenario.models.ShapeMetadata import get_all_with_etl_status [as 别名]
def view_datasets():
datasets_pending = fetch_pending_tables(MetaTable)
shapes_pending = fetch_pending_tables(ShapeMetadata)
datasets = MetaTable.get_all_with_etl_status()
shapesets = ShapeMetadata.get_all_with_etl_status()
return render_template('admin/view-datasets.html',
datasets_pending=datasets_pending,
shapes_pending=shapes_pending,
datasets=datasets,
shape_datasets=shapesets)
示例2: view_datasets
# 需要导入模块: from plenario.models import ShapeMetadata [as 别名]
# 或者: from plenario.models.ShapeMetadata import get_all_with_etl_status [as 别名]
def view_datasets():
datasets_pending = session.query(MetaTable).\
filter(MetaTable.approved_status != True).\
all()
shapes_pending = session.query(ShapeMetadata).\
filter(ShapeMetadata.approved_status != True).\
all()
try:
q = text('''
SELECT m.*, c.status, c.task_id
FROM meta_master AS m
LEFT JOIN celery_taskmeta AS c
ON c.id = (
SELECT id FROM celery_taskmeta
WHERE task_id = ANY(m.result_ids)
ORDER BY date_done DESC
LIMIT 1
)
WHERE m.approved_status = 'true'
''')
with engine.begin() as c:
datasets = list(c.execute(q))
except NoSuchTableError:
datasets = session.query(MetaTable)\
.filter(MetaTable.approved_status == True)\
.all()
try:
shape_datasets = ShapeMetadata.get_all_with_etl_status()
except NoSuchTableError:
# If we can't find shape metadata, soldier on.
shape_datasets = None
return render_template('admin/view-datasets.html',
datasets_pending=datasets_pending,
shapes_pending=shapes_pending,
datasets=datasets,
shape_datasets=shape_datasets)