本文整理匯總了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)