Source code for py_abac.policy.conditions.numeric.lt

"""
    Numeric less than conditions
"""

from marshmallow import post_load

from .base import NumericCondition, NumericConditionSchema


[docs]class Lt(NumericCondition): """ Condition for number `what` less than `value` """ def _is_satisfied(self, what) -> bool: return what < self.value
[docs]class LtSchema(NumericConditionSchema): """ JSON schema for less than numeric condition """
[docs] @post_load def post_load(self, data, **_): # pylint: disable=missing-docstring,no-self-use return Lt(**data)