summaryrefslogtreecommitdiff
path: root/repoze/bfg/sampleapp/models.py
blob: 975d791422db6f67215e7fd6b56aee70f950a3f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from zope.interface import Interface
from zope.interface import implements

import datetime

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()