forked from erp-dev/erp
117 lines
3.3 KiB
Python
117 lines
3.3 KiB
Python
"""工具包。
|
|
|
|
历史上 `flower.utils` 是一个单文件模块(`utils.py`)。
|
|
为了降低耦合并便于扩展,现已拆分为目录包,并在此保留向后兼容的导出。
|
|
|
|
- 明道云相关:`flower.utils.mingdaoyun.*`
|
|
"""
|
|
|
|
from .mingdaoyun import (
|
|
HTTPMethod,
|
|
MDY_APP_KEY,
|
|
MDY_BASE_URL,
|
|
MDY_ENDPOINT_GET_FILTER_ROWS,
|
|
MDY_SIGN,
|
|
MDY_WORKSHEET_ID_CUSTOMER,
|
|
MDY_WORKSHEET_ID_FABRIC,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_COLORING,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_COLOR_SCHEME,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_DRAWING,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_IMAGE_DEVELOPMENT,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_MODIFY_DRAWING,
|
|
MDY_WORKSHEET_ID_PLATE_ORDER_PATTERN_SET,
|
|
MDY_WORKSHEET_ID_PRODUCT,
|
|
Customer,
|
|
Fabric,
|
|
MDYAttachmentItem,
|
|
MDYCollaboratorItem,
|
|
MDYPlateOrder,
|
|
MDYRelationItem,
|
|
MingDaoYunClient,
|
|
Product,
|
|
ProductListResponse,
|
|
customer_type_map,
|
|
fabric_type_map,
|
|
fetch_customers_from_mingdaoyun,
|
|
fetch_plate_orders_from_mingdaoyun,
|
|
fetch_products_from_mingdaoyun,
|
|
fetch_row_by_rowid_from_mingdaoyun,
|
|
get_default_mingdaoyun_client,
|
|
mdy_table_map,
|
|
pick_customer,
|
|
pick_fabric,
|
|
pick_product,
|
|
plate_order_field_definitions,
|
|
plate_order_related_field_definitions,
|
|
plate_order_related_worksheet_map,
|
|
plate_order_related_worksheet_map_cn,
|
|
plate_order_relation_control_map,
|
|
plate_order_type_map,
|
|
product_type_map,
|
|
# relations / flatten utils
|
|
normalize_mdy_value,
|
|
extract_relation_rowids,
|
|
extract_plate_order_related_rowids,
|
|
flatten_row_by_field_definitions,
|
|
flatten_plate_order_related_row,
|
|
sync_fabric_from_mingdaoyun,
|
|
)
|
|
|
|
__all__ = [
|
|
# client
|
|
"HTTPMethod",
|
|
"MingDaoYunClient",
|
|
"get_default_mingdaoyun_client",
|
|
"MDY_BASE_URL",
|
|
"MDY_ENDPOINT_GET_FILTER_ROWS",
|
|
"MDY_APP_KEY",
|
|
"MDY_SIGN",
|
|
# worksheet ids / maps
|
|
"mdy_table_map",
|
|
"MDY_WORKSHEET_ID_PRODUCT",
|
|
"MDY_WORKSHEET_ID_CUSTOMER",
|
|
"MDY_WORKSHEET_ID_FABRIC",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_DRAWING",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_COLORING",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_PATTERN_SET",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_MODIFY_DRAWING",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_COLOR_SCHEME",
|
|
"MDY_WORKSHEET_ID_PLATE_ORDER_IMAGE_DEVELOPMENT",
|
|
"product_type_map",
|
|
"customer_type_map",
|
|
"fabric_type_map",
|
|
"plate_order_field_definitions",
|
|
"plate_order_related_field_definitions",
|
|
"plate_order_related_worksheet_map",
|
|
"plate_order_related_worksheet_map_cn",
|
|
"plate_order_relation_control_map",
|
|
"plate_order_type_map",
|
|
# relations / flatten utils
|
|
"normalize_mdy_value",
|
|
"extract_relation_rowids",
|
|
"extract_plate_order_related_rowids",
|
|
"flatten_row_by_field_definitions",
|
|
"flatten_plate_order_related_row",
|
|
# models
|
|
"Product",
|
|
"ProductListResponse",
|
|
"Customer",
|
|
"Fabric",
|
|
"MDYRelationItem",
|
|
"MDYAttachmentItem",
|
|
"MDYCollaboratorItem",
|
|
"MDYPlateOrder",
|
|
# parsers
|
|
"pick_product",
|
|
"pick_customer",
|
|
"pick_fabric",
|
|
# fetch
|
|
"fetch_products_from_mingdaoyun",
|
|
"fetch_customers_from_mingdaoyun",
|
|
"fetch_row_by_rowid_from_mingdaoyun",
|
|
"fetch_plate_orders_from_mingdaoyun",
|
|
"sync_fabric_from_mingdaoyun",
|
|
]
|