资 源 简 介
Library with a lot of unit test to help creation of Entities and ValueObjects in Python with easy validation, inspired by sintax of GORM of Groovy.
Class Entity and ValueObject extends DataObject class. The DataObject class has a common implementation of str and ValueObject has an common implementation of eq and ne methods.
Class OrderedValueObject extends ValueObject and implement lt, le, gt and ge methods with easy customization.
This project is independent of database or web-frameworks stuff, like most of programs of validation. So you can use it in Scripts/GUI/Console/WebApplications programs without necessity of adaptation and configuration files. It is also extensible and easy to register new constraints for validation.
Example of usage:
Entity
```
from domain import dataobjects
class MyEntity(dataObject.Entity):
def __init__(self):
self.someint = 1
self.somefloat = 1.23
self.somestring = "ab