Coverage for src/backend/InvenTree/generic/enums.py: 83%

6 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 17:47 +0000

1"""Generic enum type definitions.""" 

2 

3import enum 

4 

5 

6class StringEnum(str, enum.Enum): 

7 """Base class for string-based enumerations.""" 

8 

9 def __str__(self): 

10 """Return the string representation of the enumeration value.""" 

11 return str(self.value) 

12 

13 def __repr__(self): 

14 """Return the string representation of the enumeration value.""" 

15 return str(self.value)