Project | Techs | How to use | License
🐺 Python implementation of Domain Notification Pattern based in Flunt(.NET), JFlunt(Java) developed by @andrebaltieri, @carlosbritojun
pip install pyflunt
from pyflunt.notifications import Notifiable, Notification
class Name(Notifiable):
def __init__(self, name):
super().__init__()
if len(name) > 3:
self.add_notification(Notification(field='name', message='invalid name'))
self._name = name
from pyflunt.notifications import Notifiable
from pyflunt.validations import Contract
class Email(Notifiable):
def __init__(self, email):
super().__init__()
self._email = email
contract = (Contract().requires()
.has_max_len(value=email,
maximum=50,
message='invalid email')
.is_email(value=email,
field='email',
message='invalid email'))
self.add_notifications(contract)
This project contains the MIT license. See the file LICENSE.