Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
CMFDefault.DiscussionItem.DiscussionItem Class Reference
Inheritance diagram for CMFDefault.DiscussionItem.DiscussionItem:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.DiscussionItem.DiscussionItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def listCreators
def inReplyTo
def setReplyTo
def parentsInThread

Public Attributes

 creators

Static Public Attributes

string meta_type = 'Discussion Item'
string portal_type = 'Discussion Item'
int allow_discussion = 1
 in_reply_to = None
string review_state = 'published'
tuple security = ClassSecurityInfo()

Static Private Attributes

tuple __implements__ = (z2IDiscussionResponse, Document.__implements__)

Detailed Description

Class for content which is a response to other content.

Definition at line 72 of file DiscussionItem.py.


Member Function Documentation

def CMFDefault.DiscussionItem.DiscussionItem.inReplyTo (   self,
  REQUEST = None 
)
Return the IDiscussable object to which we are a reply.

    Two cases obtain:

      - We are a "top-level" reply to a non-DiscussionItem piece
of content;  in this case, our 'in_reply_to' field will
be None.

      - We are a nested reply;  in this case, our 'in_reply_to'
field will be the ID of the parent DiscussionItem.

Definition at line 105 of file DiscussionItem.py.

00105 
00106     def inReplyTo( self, REQUEST=None ):
00107         """ Return the IDiscussable object to which we are a reply.
00108 
00109             Two cases obtain:
00110 
00111               - We are a "top-level" reply to a non-DiscussionItem piece
00112                 of content;  in this case, our 'in_reply_to' field will
00113                 be None.
00114 
00115               - We are a nested reply;  in this case, our 'in_reply_to'
00116                 field will be the ID of the parent DiscussionItem.
00117         """
00118         tool = getUtility(IDiscussionTool)
00119         talkback = tool.getDiscussionFor( self )
00120         return talkback._getReplyParent( self.in_reply_to )

List Dublin Core Creator elements - resource authors.

Definition at line 90 of file DiscussionItem.py.

00090 
00091     def listCreators(self):
00092         """ List Dublin Core Creator elements - resource authors.
00093         """
00094         if not hasattr(aq_base(self), 'creators'):
00095             # for content created with CMF versions before 1.5
00096             if hasattr(aq_base(self), 'creator') and self.creator != 'unknown':
00097                 self.creators = ( self.creator, )
00098             else:
00099                 self.creators = ()
00100         return self.creators

Here is the call graph for this function:

Here is the caller graph for this function:

    Return the list of items which are "above" this item in
    the discussion thread.

    If 'size' is not zero, only the closest 'size' parents
    will be returned.

Definition at line 132 of file DiscussionItem.py.

00132 
00133     def parentsInThread( self, size=0 ):
00134         """
00135             Return the list of items which are "above" this item in
00136             the discussion thread.
00137 
00138             If 'size' is not zero, only the closest 'size' parents
00139             will be returned.
00140         """
00141         parents = []
00142         current = self
00143         while not size or len( parents ) < size:
00144             parent = current.inReplyTo()
00145             assert not parent in parents  # sanity check
00146             parents.insert( 0, parent )
00147             if parent.meta_type != self.meta_type:
00148                 break
00149             current = parent
00150         return parents
00151 
00152 InitializeClass( DiscussionItem )
00153 

    Make this object a response to the passed object.

Definition at line 122 of file DiscussionItem.py.

00122 
00123     def setReplyTo( self, reply_to ):
00124         """
00125             Make this object a response to the passed object.
00126         """
00127         if getattr( reply_to, 'meta_type', None ) == self.meta_type:
00128             self.in_reply_to = reply_to.getId()
00129         else:
00130             self.in_reply_to = None


Member Data Documentation

tuple CMFDefault.DiscussionItem.DiscussionItem.__implements__ = (z2IDiscussionResponse, Document.__implements__) [static, private]

Definition at line 78 of file DiscussionItem.py.

Definition at line 82 of file DiscussionItem.py.

Definition at line 96 of file DiscussionItem.py.

Definition at line 83 of file DiscussionItem.py.

string CMFDefault.DiscussionItem.DiscussionItem.meta_type = 'Discussion Item' [static]

Definition at line 80 of file DiscussionItem.py.

string CMFDefault.DiscussionItem.DiscussionItem.portal_type = 'Discussion Item' [static]

Definition at line 81 of file DiscussionItem.py.

Definition at line 85 of file DiscussionItem.py.

tuple CMFDefault.DiscussionItem.DiscussionItem.security = ClassSecurityInfo() [static]

Definition at line 87 of file DiscussionItem.py.


The documentation for this class was generated from the following file: