18 lines
541 B
Python
18 lines
541 B
Python
CONTINUOUS_DIE_STAMPING_METHOD = "连续模"
|
|
|
|
|
|
def clean_text(value: str | None) -> str:
|
|
return str(value or "").strip()
|
|
|
|
|
|
def is_continuous_die_stamping_method(value: str | None) -> bool:
|
|
return clean_text(value) == CONTINUOUS_DIE_STAMPING_METHOD
|
|
|
|
|
|
def is_continuous_die_product(product) -> bool:
|
|
return bool(product) and is_continuous_die_stamping_method(getattr(product, "stamping_method", None))
|
|
|
|
|
|
def is_continuous_die_item(item) -> bool:
|
|
return is_continuous_die_stamping_method(getattr(item, "stamping_method", None))
|