From 9a91b6f9ed2e84c31879a327654dc25732cc8da7 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 29 May 2009 06:30:55 +0000 Subject: [PATCH] change import for discussion modification_date from datetime to DateTime. svn path=/plone.app.discussion/trunk/; revision=27204 --- plone/app/discussion/comment.py | 46 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 4425033..94be10d 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -1,6 +1,6 @@ """The default comment class and factory. """ -from datetime import datetime +from DateTime import DateTime from zope.interface import implements from zope.component.factory import Factory @@ -16,73 +16,73 @@ from Products.CMFCore.utils import getToolByName class Comment(DynamicType, Traversable, RoleManager, Owned, Explicit): """A comment. - + This object attempts to be as lightweight as possible. We implement a number of standard methods instead of subclassing, to have total control over what goes into the object. """ - + implements(IComment) - + meta_type = portal_type = 'Discussion Item' - + __parent__ = None - + comment_id = None # long in_reply_to = None # long title = u"" - + mime_type = "text/plain" text = u"" - + creator = None creation_date = None modification_date = None - + author_username = None - + author_name = None author_email = None - - # Note: we want to use zope.component.createObject() to instantiate + + # Note: we want to use zope.component.createObject() to instantiate # comments as far as possible. comment_id and __parent__ are set via # IConversation.addComment(). - + def __init__(self): - self.creation_date = self.modification_date = datetime.now() - + self.creation_date = self.modification_date = DateTime() + @property def __name__(self): return self.comment_id and unicode(self.comment_id) or None - + @property def id(self): return self.comment_id and str(self.comment_id) or None - + def getId(self): """The id of the comment, as a string """ return self.id - + def Title(self): """The title of the comment """ return self.title - + def Creator(self): """The name of the person who wrote the comment """ return self.creator - + # CMF's event handlers assume any IDynamicType has these :( - + def opaqueItems(self): return [] - + def opaqueIds(self): return [] - + def opaqueValues(self): return []