Hi I would like to have a file that contain an enum list of all the items I will be using in my configuration. E.G
{
"SUCCESS": 1,
"FAILED": 1,
"PENDING": 1,
}
I wanted something like in Laravel where in you will only place all your Enum in one of the files. In Laravel I can place this inside the folder config and file list_item e.g
return [
"SUCCESS": 1,
"FAILED": 1,
"PENDING": 1,
]
so if I reference this in laravel its like config('config.list_item') and this will contain the array that I defined in my list_item file. Is there a way to achieve the same approach in Python/Flask? The only way I can think of is creating a file and inside it I will be defining a function like the example below
def StatusEnum():
return {
"SUCCESS": 1,
"FAILED": 1,
"PENDING": 1,
}
and referencing it with StatusEnum() but I want to have a cleaner way to this.
So basically I want a cleaner and best approach to have a file that contains all my Enum list. I wan't to know how to do this in python/flask.