diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-07-08 14:25:46 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-07-08 14:25:46 +0000 |
| commit | a1f12be881a025d0640052554e8d53cdfe19afa9 (patch) | |
| tree | de2fd7cf49a7307c3fed92f5bdd18d4804d019ac /repoze/bfg/sampleapp/models.py | |
| parent | 41aeaa3c4c22380f076c1989cfd1b52600751286 (diff) | |
| download | pyramid-a1f12be881a025d0640052554e8d53cdfe19afa9.tar.gz pyramid-a1f12be881a025d0640052554e8d53cdfe19afa9.tar.bz2 pyramid-a1f12be881a025d0640052554e8d53cdfe19afa9.zip | |
Redirect on default view if name doesn't end with slash.
Rejigger sample app, adding more templates.
Diffstat (limited to 'repoze/bfg/sampleapp/models.py')
| -rw-r--r-- | repoze/bfg/sampleapp/models.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/repoze/bfg/sampleapp/models.py b/repoze/bfg/sampleapp/models.py index 19ef03c8c..975d79142 100644 --- a/repoze/bfg/sampleapp/models.py +++ b/repoze/bfg/sampleapp/models.py @@ -1,12 +1,28 @@ from zope.interface import Interface -from zope.interface import Attribute from zope.interface import implements -class IBlogModel(Interface): - id = Attribute('id') +import datetime -class BlogModel(object): - implements(IBlogModel) - def __init__(self, id): - self.id = id +class IMapping(Interface): + pass +class IBlog(Interface): + pass + +class Blog(dict): + implements(IBlog, IMapping) + def __init__(self, name): + self.__name__ = name + dict.__init__(self) + +class IBlogEntry(Interface): + pass + +class BlogEntry(object): + implements(IBlogEntry) + def __init__(self, name, title, body, author): + self.__name__ = name + self.title = title + self.body = body + self.author = author + self.created = datetime.datetime.now() |
