summaryrefslogtreecommitdiff
path: root/test/zblog/blog.py
blob: 04dd33ac51557269c31f5ff6a6d67738323cdbc1 (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
29
30
31
32
33
34
__all__ = ['Blog', 'Post', 'Topic', 'TopicAssociation', 'Comment']

import datetime

class Blog(object):
    def __init__(self, owner=None):
        self.owner = owner

class Post(object):
    topics = set
    def __init__(self, user=None, headline=None, summary=None):
        self.user = user
        self.datetime = datetime.datetime.today()
        self.headline = headline
        self.summary = summary
        self.comments = []
        self.comment_count = 0

class Topic(object):
    def __init__(self, keyword=None, description=None):
        self.keyword = keyword
        self.description = description

class TopicAssociation(object):
    def __init__(self, post=None, topic=None, is_primary=False):
        self.post = post
        self.topic = topic
        self.is_primary = is_primary

class Comment(object):
    def __init__(self, subject=None, body=None):
        self.subject = subject
        self.datetime = datetime.datetime.today()
        self.body = body