From 1a7b14de4bc89ef0fd162ef8e62d01926e42b54e Mon Sep 17 00:00:00 2001 From: Paul Everitt Date: Thu, 24 Jul 2008 17:14:16 +0000 Subject: Add tutorial sections --- docs/tutorials/lxmlgraph/step01/myapp/models.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docs/tutorials/lxmlgraph/step01/myapp/models.py (limited to 'docs/tutorials/lxmlgraph/step01/myapp/models.py') 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 -- cgit v1.2.3