minos.common.model.types.model_types
Classes
Field Type class. |
|
Model Type class. |
- class ModelType[source]
Bases:
type
Model Type class.
- classmethod build(name_, type_hints_=None, *, namespace_=None, **kwargs)[source]
Build a new
ModelType
instance.- Parameters
- Returns
A
ModelType
instance.- Return type
- classmethod from_typed_dict(typed_dict)[source]
Build a new
ModelType
instance from atyping.TypedDict
.- Parameters
typed_dict – Typed dict to be used as base.
- Returns
A
ModelType
instance.- Return type
- property model_cls: Type[Model]
Get the model class if defined or
DataTransferObject
otherwise.- Returns
A model class.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- mro()
Return a type’s method resolution order.
- class FieldType[source]
Bases:
NamedTuple
Field Type class.
- static __new__(_cls, name, type)
Create new instance of FieldType(name, type)
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.