Files
cdtestplant_v1/apps/createDocument/extensions/tools.py
2026-01-28 16:50:40 +08:00

10 lines
343 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from apps.project.models import TestDemand
def demand_sort_by_designKey(demand_obj: TestDemand) -> tuple[int, ...]:
"""仅限于测试项排序函数传入sorted函数的key里面"""
parts = demand_obj.key.split('-')
sort_tuple = tuple(int(part) for part in parts)
return sort_tuple
__all__ = ['demand_sort_by_designKey']