summaryrefslogtreecommitdiff
path: root/repoze/bfg/sampleapp/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'repoze/bfg/sampleapp/models.py')
-rw-r--r--repoze/bfg/sampleapp/models.py30
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()