mirror of
				https://github.com/spbleadersofdigtal/backend.git
				synced 2025-11-04 09:37:32 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			10 lines
		
	
	
		
			289 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
		
			289 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from collections.abc import Iterable
 | 
						|
 | 
						|
from django.db.models.enums import ChoicesMeta
 | 
						|
 | 
						|
 | 
						|
def count_max_length(choices: Iterable | ChoicesMeta):
 | 
						|
    if isinstance(choices, ChoicesMeta):
 | 
						|
        return max([len(val) for val in choices.values])
 | 
						|
    return max([len(val) for val, _ in choices])
 |