diff options
author | Brian Waldon <bcwaldon@gmail.com> | 2012-06-01 14:33:49 -0700 |
---|---|---|
committer | Brian Waldon <bcwaldon@gmail.com> | 2012-06-01 14:33:49 -0700 |
commit | b1f4a0b9d23fe8279ca2d17d391c34693892b1c2 (patch) | |
tree | 172a54c54e6ab5dc58396d0624f44ee2a8e18c23 | |
parent | a5be0449637268b9d6822bcc7b359ba85b9e5f44 (diff) | |
download | warlock-b1f4a0b9d23fe8279ca2d17d391c34693892b1c2.tar.gz |
Adding README
-rw-r--r-- | README | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +# Warlock! + +1) Create a class + + import warlock + + schema = { + 'name': 'Country': + 'properties': { + 'name': {'type': 'string'}, + 'abbreviation': {'type': 'string'}, + }, + } + + Country = warlock.schema_class(schema) + +2) Create an object using your class + + sweden = Country(name='Sweden', abbreviation='SE') + +3) Let the object validate itself! + + sweden.name = 5 + # Raises ValueError + + sweden.overlord = 'Brian' + # Raises AttributeError |