判断字符串是否为有效的UUID
(uuid_string)
| 406 | |
| 407 | |
| 408 | def is_valid_uuid(uuid_string): |
| 409 | """判断字符串是否为有效的UUID""" |
| 410 | try: |
| 411 | uuid_obj = uuid.UUID(uuid_string) |
| 412 | return str(uuid_obj) == uuid_string |
| 413 | except ValueError: |
| 414 | return False |
| 415 | |
| 416 | |
| 417 | def common_convert_value(_type, value): |