summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-06-01 14:33:49 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-06-01 14:33:49 -0700
commitb1f4a0b9d23fe8279ca2d17d391c34693892b1c2 (patch)
tree172a54c54e6ab5dc58396d0624f44ee2a8e18c23
parenta5be0449637268b9d6822bcc7b359ba85b9e5f44 (diff)
downloadwarlock-b1f4a0b9d23fe8279ca2d17d391c34693892b1c2.tar.gz
Adding README
-rw-r--r--README27
1 files changed, 27 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..760fd12
--- /dev/null
+++ b/README
@@ -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