Table of Contents

Class: ForumDB | Twisted-0.17.4/twisted/forum/manager.py
--- | ---

This class handles interactions with the forums database. It holds all the SQL code used.

Database operations include: - create a forum - delete a forum - get the list of forums - post a new message (start a thread) - post a reply to a message - get all the threads in a forum - get all the posts in a thread - get details of a message

This class operates asynchronously. The query methods (getTopMessages and getThreadMessages) return Deferreds which will be called when the query has finished.

This class caches the names of the forums in the database.

Base Classes |
--- | ---
adbapi.Augmentation

Methods |
--- | ---

__init__ _finishPerspective _forumCreator _messagePoster _userCreator cacheForums createForum createUser deleteForum getForumByID | getForums getFullMessages getMessage getThreadMessages getTopMessages gotForums loadPerspective newMessage postMessage

| __init__

    __init__ ( self,  dbpool )

| _finishPerspective

    _finishPerspective ( self,  result )

Exceptions |
--- | ---
KeyError( "Perspective not found." )

| _forumCreator

    _forumCreator (
            self,
            trans,
            name,
            description,
            default_access,
            )

| _messagePoster

    _messagePoster (
            self,
            trans,
            forum_id,
            user_name,
            thread_id,
            parent_id,
            previous_id,
            subject,
            body,
            )

| _userCreator

    _userCreator (
            self,
            trans,
            username,
            signature,
            )

| cacheForums

    cacheForums ( self )

| createForum

    createForum (
            self,
            name,
            description,
            default_access,
            )

Create a new forum with this name.

| createUser

    createUser (
            self,
            username,
            signature,
            )

Create a new user in the system and set default permissions. This is complex as it must interface with the dbAuthorizer.

| deleteForum

    deleteForum ( self,  forum_id )

Delete the forum with this name and all posted messages in it.

| getForumByID

    getForumByID ( self,  id )

Get the name of a forum by it's ID.

| getForums

    getForums ( self,  user_name )

Gets the list of forums and the number of msgs in each one. Only shows forums the user has access to.

| getFullMessages

    getFullMessages (
            self,
            forum_id,
            thread_id,
            user_name,
            )

Get the messages in a thread in a forum. This returns a set of columns (id, parent_id, subject, post_date, username, body)

| getMessage

    getMessage ( self,  post_id )

Get the details of a single message.

| getThreadMessages

    getThreadMessages (
            self,
            forum_id,
            thread_id,
            user_name,
            )

Get the messages in a thread in a forum. This returns a set of columns (id, parent_id, subject, post_date, username)

| getTopMessages

    getTopMessages (
            self,
            forum_id,
            user_name,
            )

Get the top-level messages in the forum - those that begin threads. This returns a set of the columns (id, subject, post date, username, # replies) for the forum

| gotForums

    gotForums ( self,  data )

| loadPerspective

    loadPerspective ( self,  name )

| newMessage

    newMessage (
            self,
            forum_id,
            user_name,
            subject,
            body,
            )

Post a new message - start a new thread.

| postMessage

    postMessage (
            self,
            forum_id,
            user_name,
            thread_id,
            parent_id,
            previous_id,
            subject,
            body,
            )

Post a message to a forum.

Table of Contents

This document was automatically generated on Sat Apr 20 01:31:02 2002 by HappyDoc version 2.0