2016-12-16 00:29:59 -06:00
|
|
|
"""The Great Escape model objects.
|
|
|
|
|
|
|
|
Note that, depending on the forum software, terms might have different meanings.
|
|
|
|
For example, sometimes "board" refers to the entire site and "forum" to a subsection.
|
|
|
|
"""
|
|
|
|
|
|
|
|
# pylint: disable=too-few-public-methods, too-many-arguments
|
|
|
|
|
|
|
|
class Forum(object):
|
|
|
|
"""Forum represents an entire web forum."""
|
|
|
|
def __init__(self, title=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.title = title
|
|
|
|
self.users = []
|
|
|
|
self.categories = []
|
|
|
|
|
2016-12-16 00:29:59 -06:00
|
|
|
class Post(object):
|
|
|
|
"""Post represents a singular post in a thread."""
|
|
|
|
def __init__(self, title=None, body=None, author=None, timestamp=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.title = title
|
|
|
|
self.body = body
|
|
|
|
self.author = author
|
2016-11-27 00:42:27 -06:00
|
|
|
self.timestamp = timestamp
|
2016-11-26 23:09:12 -06:00
|
|
|
|
2016-12-16 00:29:59 -06:00
|
|
|
class Thread(object):
|
|
|
|
"""Thread represents a thread, or topic, in a board, on a forum."""
|
|
|
|
def __init__(self, title=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.title = title
|
|
|
|
self.children = []
|
|
|
|
|
2016-12-16 00:29:59 -06:00
|
|
|
class User(object):
|
|
|
|
"""User represents an individual user of a forum."""
|
|
|
|
def __init__(self, name=None, signature=None, avatar=None, title=None, subtitle=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.name = name
|
|
|
|
self.signature = signature
|
2016-11-27 00:43:11 -06:00
|
|
|
self.title = title
|
|
|
|
self.subtitle = subtitle
|
|
|
|
self.avatar = avatar
|
2016-11-26 23:09:12 -06:00
|
|
|
|
2016-12-16 00:29:59 -06:00
|
|
|
class Category(object):
|
|
|
|
"""Category represents a category of boards.
|
|
|
|
Note however in some forum software categories are a type of board."""
|
|
|
|
def __init__(self, title=None, description=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.title = title
|
|
|
|
self.description = description
|
|
|
|
self.children = []
|
|
|
|
|
2016-12-16 00:29:59 -06:00
|
|
|
class Board(object):
|
|
|
|
"""Board represents a board which contains threads."""
|
|
|
|
def __init__(self, title=None, description=None):
|
2016-11-26 23:09:12 -06:00
|
|
|
self.title = title
|
|
|
|
self.description = description
|
|
|
|
self.children = []
|