[Zope3-checkins] CVS: zopeproducts/zwiki/browser - wikipage.py:1.5

Stephan Richter srichter@cbu.edu
Sat, 12 Apr 2003 19:06:05 -0400


Update of /cvs-repository/zopeproducts/zwiki/browser
In directory cvs.zope.org:/tmp/cvs-serv13171/browser

Modified Files:
	wikipage.py 
Log Message:
- Finished a bunch of promised tests. Except for Views everything is tested
  now.

- Reworked the source type registry a bit to be more flexible. Now the
  actual implementation of a source type interface is also registered. I
  moved the createComment() method into the source class, since this is 
  where it belongs. We only want one createComment() method for each source
  and not for each renderer.


=== zopeproducts/zwiki/browser/wikipage.py 1.4 => 1.5 ===
--- zopeproducts/zwiki/browser/wikipage.py:1.4	Thu Apr 10 21:37:46 2003
+++ zopeproducts/zwiki/browser/wikipage.py	Sat Apr 12 19:05:34 2003
@@ -17,6 +17,7 @@
 """
 import re
 from urllib import quote, unquote
+from datetime import datetime
 
 from zope.app.interfaces.dublincore import ICMFDublinCore
 
@@ -317,9 +318,11 @@
     def comment(self, comment):
         types = getService(self.context, "WikiSourceTypeRegistry")
         source = types.createObject(self.context.type, self.context.source)
-        view = getView(source, None, self.request)
-        comment = view.createComment(comment,
-                                     self.context.getCommentCounter())
+        comment = source.createComment(
+            comment,
+            self.context.getCommentCounter(),
+            self.request.user.getLogin(),
+            datetime.now().strftime('%m/%d/%Y %H:%M:%S'))
         self.context.comment(comment)
         return self.request.response.redirect('.')