當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。