mirror of
https://github.com/task-17-lct/backend.git
synced 2024-11-24 05:23:42 +03:00
10 lines
270 B
Python
10 lines
270 B
Python
from collections.abc import Iterable
|
|
|
|
from django.db.models.enums import ChoicesMeta
|
|
|
|
|
|
def count_max_length(choices: any):
|
|
if isinstance(choices, ChoicesMeta):
|
|
return max([len(val) for val in choices.values])
|
|
return max([len(val) for val, _ in choices])
|