commit | author | age
|
e53e13
|
1 |
from persistent import Persistent |
CM |
2 |
from persistent.mapping import PersistentMapping |
|
3 |
|
|
4 |
class Wiki(PersistentMapping): |
|
5 |
__name__ = None |
|
6 |
__parent__ = None |
|
7 |
|
|
8 |
class Page(Persistent): |
|
9 |
def __init__(self, data): |
|
10 |
self.data = data |
|
11 |
|
|
12 |
def appmaker(zodb_root): |
b8f579
|
13 |
if 'app_root' not in zodb_root: |
e53e13
|
14 |
app_root = Wiki() |
CM |
15 |
frontpage = Page('This is the front page') |
|
16 |
app_root['FrontPage'] = frontpage |
|
17 |
frontpage.__name__ = 'FrontPage' |
|
18 |
frontpage.__parent__ = app_root |
|
19 |
zodb_root['app_root'] = app_root |
|
20 |
return zodb_root['app_root'] |