summaryrefslogtreecommitdiff
path: root/docs/tutorials/lxmlgraph/step01/myapp/models.py
blob: 85d603d8007464be81f993c8a8fab7080ea1ee98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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