flask_boilerplate.domain.enums package
Submodules
flask_boilerplate.domain.enums.enum_example module
Example enumeration for the domain layer.
This module defines an example enumeration to demonstrate how to create and use enums within the domain layer. Enums are useful for representing a fixed set of constants or options in a type-safe manner.
Example
>>> from flask_boilerplate.domain.enums.enum_example import EnumExample
>>> status = EnumExample.ACTIVE
>>> print(status)
EnumExample.ACTIVE
- class flask_boilerplate.domain.enums.enum_example.EnumExample(*values)[source]
Bases:
EnumExample enumeration for the domain layer.
This enum represents a set of predefined states or options that can be used within the domain logic. Each member of the enum is a constant with a unique value.
- ACTIVE
Represents an active state.
- INACTIVE
Represents an inactive state.
- PENDING
Represents a pending state.
- ACTIVE = 'active'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- __str__() str[source]
Return the string representation of the enum member.
- Returns:
The string representation of the enum member.
- Return type:
str
Module contents
Module for defining enumerations in the domain layer.
Enumerations are used to represent a fixed set of constants or options within the domain. They provide a type-safe way to work with predefined values and ensure consistency across the application.
This module serves as the entry point for all enumerations in the domain layer. It exports the necessary enums to be used across the application.
Example
>>> from flask_boilerplate.domain.enums import MyEnum
>>> my_value = MyEnum.VALUE1
>>> print(my_value)
MyEnum.VALUE1
- class flask_boilerplate.domain.enums.EnumExample(*values)[source]
Bases:
EnumExample enumeration for the domain layer.
This enum represents a set of predefined states or options that can be used within the domain logic. Each member of the enum is a constant with a unique value.
- ACTIVE
Represents an active state.
- INACTIVE
Represents an inactive state.
- PENDING
Represents a pending state.
- ACTIVE = 'active'
- INACTIVE = 'inactive'
- PENDING = 'pending'
- __str__() str[source]
Return the string representation of the enum member.
- Returns:
The string representation of the enum member.
- Return type:
str