当前位置: 首页>>代码示例>>Python>>正文


Python ShapeMetadata.get_all_with_etl_status方法代码示例

本文整理汇总了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)
开发者ID:UrbanCCD-UChicago,项目名称:plenario,代码行数:13,代码来源:views.py

示例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)
开发者ID:anukat2015,项目名称:plenario,代码行数:42,代码来源:views.py


注:本文中的plenario.models.ShapeMetadata.get_all_with_etl_status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。