summaryrefslogtreecommitdiff
path: root/docs/tutorials/lxmlgraph/step01/myapp/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/lxmlgraph/step01/myapp/models.py')
-rw-r--r--docs/tutorials/lxmlgraph/step01/myapp/models.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/tutorials/lxmlgraph/step01/myapp/models.py b/docs/tutorials/lxmlgraph/step01/myapp/models.py
new file mode 100644
index 000000000..85d603d80
--- /dev/null
+++ b/docs/tutorials/lxmlgraph/step01/myapp/models.py
@@ -0,0 +1,18 @@
+from zope.interface import implements
+from zope.interface import Attribute
+from zope.interface import Interface
+
+class IMyModel(Interface):
+ __name__ = Attribute('Name of the model instance')
+
+class MyModel(dict):
+ implements(IMyModel)
+ def __init__(self, name):
+ self.__name__ = name
+
+root = MyModel('site')
+root['a'] = MyModel('a')
+root['b'] = MyModel('b')
+
+def get_root(environ):
+ return root