[Zope3-checkins] CVS: Products3/demo/messageboard/step7/browser - configure.zcml:1.3 message.py:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 21 16:06:03 EDT 2003


Update of /cvs-repository/Products3/demo/messageboard/step7/browser
In directory cvs.zope.org:/tmp/cvs-serv32548/step7/browser

Modified Files:
	configure.zcml message.py 
Log Message:
Updated Step 7


=== Products3/demo/messageboard/step7/browser/configure.zcml 1.2 => 1.3 ===
--- Products3/demo/messageboard/step7/browser/configure.zcml:1.2	Sun Aug  3 14:35:04 2003
+++ Products3/demo/messageboard/step7/browser/configure.zcml	Thu Aug 21 15:05:32 2003
@@ -1,8 +1,7 @@
 <configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:browser="http://namespaces.zope.org/browser"
-   i18n_domain="messageboard"
-   >
+   i18n_domain="messageboard">
 
   <!-- IMessageBoard Views -->
 
@@ -125,10 +124,10 @@
   </browser:pages>
 
   <browser:menuItem
-    menu="add_message"
-    for="zope.app.interfaces.container.IAdding"
-    action="AddMessage"
-    title="Message"/>
+      menu="add_message"
+      for="zope.app.interfaces.container.IAdding"
+      action="AddMessage"
+      title="Message"/>
 
   <browser:menuItem 
       menu="add_message"


=== Products3/demo/messageboard/step7/browser/message.py 1.1 => 1.2 ===
--- Products3/demo/messageboard/step7/browser/message.py:1.1	Sat Jul 12 12:43:16 2003
+++ Products3/demo/messageboard/step7/browser/message.py	Thu Aug 21 15:05:32 2003
@@ -18,8 +18,7 @@
 from zope.app.interfaces.dublincore import ICMFDublinCore
 from zopeproducts.messageboard.interfaces import IMessage, IMailSubscriptions
 
-from zope.component import getAdapter
-from zope.app.traversing import getParent, getName
+from zope.app import zapi
 from zope.app.browser.container.adding import Adding
 
 
@@ -27,16 +26,16 @@
 
     def author(self):
         """Get user who last modified the Wiki Page."""
-        creators = getAdapter(self.context, ICMFDublinCore).creators
+        creators = zapi.getAdapter(self.context, ICMFDublinCore).creators
         if not creators:
             return 'unknown'
         return creators[0]
 
     def modified(self):
         """Get last modification date."""
-        date = getAdapter(self.context, ICMFDublinCore).modified
+        date = zapi.getAdapter(self.context, ICMFDublinCore).modified
         if date is None:
-            date = getAdapter(self.context, ICMFDublinCore).created
+            date = zapi.getAdapter(self.context, ICMFDublinCore).created
         if date is None:
             return ''
         formatter = self.request.locale.getDateTimeFormatter('medium')
@@ -44,16 +43,17 @@
 
     def parent_info(self):
         """Get the parent of the message"""
-        parent = getParent(self.context)
+        parent = zapi.getParent(self.context)
         if not IMessage.isImplementedBy(parent):
             return None
-        return {'name': getName(parent), 'title': parent.title}
+        return {'name': zapi.name(parent), 'title': parent.title}
 
 
 class MailSubscriptions:
 
     def subscriptions(self):
-        return getAdapter(self.context, IMailSubscriptions).getSubscriptions()
+        return zapi.getAdapter(self.context,
+                               IMailSubscriptions).getSubscriptions()
 
     def change(self):
         if 'ADD' in self.request:
@@ -62,10 +62,9 @@
                        IMailSubscriptions).addSubscriptions(emails)
         elif 'REMOVE' in self.request:
             emails = self.request['remails']
-            print emails
             if isinstance(emails, (str, unicode)):
                 emails = [emails]
-            getAdapter(self.context,
+            zapi.getAdapter(self.context,
                        IMailSubscriptions).removeSubscriptions(emails)
 
         self.request.response.redirect('.')




More information about the Zope3-Checkins mailing list