[CMF-checkins] CVS: CMF - DefaultWorkflow.py:1.2 DiscussionItem.py:1.10 File.py:1.6 Image.py:1.5 NewsItem.py:1.4 migrate_ptk.py:1.4

Martijn Pieters mj@digicool.com
Sun, 8 Apr 2001 15:18:50 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault
In directory korak:/tmp/cvs-serv30243/CMFDefault

Modified Files:
	DefaultWorkflow.py DiscussionItem.py File.py Image.py 
	NewsItem.py migrate_ptk.py 
Log Message:
Fix for issue PTK(241)[]: use of .id instead of getId().

- Replace all usage of SimpleItem.id with SimpleItem.getId(). Hold on to
  your butts! I am pretty sure that I didn't miss anything and that I didn't
  break anything, but you never know.

- Remove surplus > from CMFDefault/dtml/discussionEdit.dtml.

- Add missing > to CMFTopic/skins/topic/topic_edit.dtml, this fixes the ugly
  layout.



--- Updated File DefaultWorkflow.py in package CMF --
--- DefaultWorkflow.py	2001/04/07 23:15:10	1.1
+++ DefaultWorkflow.py	2001/04/08 19:18:17	1.2
@@ -112,7 +112,7 @@
     security.declarePrivate('getReviewStateOf')
     def getReviewStateOf(self, ob):
         tool = aq_parent(aq_inner(self))
-        status = tool.getStatusOf(self.id, ob)
+        status = tool.getStatusOf(self.getId(), ob)
         if status is not None:
             review_state = status['review_state']
         else:
@@ -291,7 +291,7 @@
 
         elif name == 'review_history':
             tool = aq_parent(aq_inner(self))
-            history = tool.getHistoryOf(self.id, ob)
+            history = tool.getHistoryOf(self.getId(), ob)
             # Make copies for security.
             return tuple(map(lambda dict: dict.copy(), history))
 
@@ -309,7 +309,7 @@
                 'time': DateTime(),
                 'comments': comment,
                 }
-            tool.setStatusOf(self.id, ob, status)
+            tool.setStatusOf(self.getId(), ob, status)
         except:
             tool.notifyException(ob, action, sys.exc_info())
             raise

--- Updated File DiscussionItem.py in package CMF --
--- DiscussionItem.py	2001/03/29 15:48:59	1.9
+++ DiscussionItem.py	2001/04/08 19:18:18	1.10
@@ -158,7 +158,7 @@
         else:
             prefix = portal_url()
 
-        return fmt_string % ( prefix, parent_rel_url, str( self.id ) )
+        return fmt_string % ( prefix, parent_rel_url, str( self.getId() ) )
 
     def getPhysicalPath(self):
         """
@@ -330,7 +330,7 @@
         for item in self._container.values():
             if item.in_reply_to == my_url:
                 if wf.getInfoFor( item, 'review_state' ) == 'published':
-                    result.append(item.id)
+                    result.append(item.getId())
 
         return result
 

--- Updated File File.py in package CMF --
--- File.py	2001/03/29 15:48:59	1.5
+++ File.py	2001/04/08 19:18:18	1.6
@@ -161,6 +161,10 @@
     # gnashing of teeth and fraying of nerves.  Don't do it.
     #
     # Really.
+    # 
+    # Note that if you use getId() to retrieve an object's ID, you will avoid
+    # this problem altogether. getId is the new way, accessing .id is
+    # deprecated.
     
     meta_type='Portal File'
     effective_date = expiration_date = None
@@ -231,7 +235,7 @@
         """
 
         RESPONSE.setHeader('Content-Disposition',
-                           'attachment; filename=%s' % self.id())
+                           'attachment; filename=%s' % self.getId())
         return OFS.Image.File.index_html(self, REQUEST, RESPONSE)
 
     index_html = download

--- Updated File Image.py in package CMF --
--- Image.py	2001/03/29 15:48:59	1.4
+++ Image.py	2001/04/08 19:18:18	1.5
@@ -159,6 +159,10 @@
     # gnashing of teeth and fraying of nerves.  Don't do it.
     #
     # Really.
+    # 
+    # Note that if you use getId() to retrieve an object's ID, you will avoid
+    # this problem altogether. getId is the new way, accessing .id is
+    # deprecated.
     
     meta_type='Portal Image'
     effective_date = expiration_date = None

--- Updated File NewsItem.py in package CMF --
--- NewsItem.py	2001/03/29 15:48:59	1.3
+++ NewsItem.py	2001/04/08 19:18:18	1.4
@@ -184,7 +184,7 @@
 
             if not headers.has_key( 'Format' ): # not supplied in headers
                 from NullPortalResource import sniffContentType
-                sniffFmt = sniffContentType( self.id, body )
+                sniffFmt = sniffContentType( self.getId(), body )
                 fmt = REQUEST.get_header( 'content-type', sniffFmt )
                 headers[ 'Format' ] = fmt
 

--- Updated File migrate_ptk.py in package CMF --
--- migrate_ptk.py	2001/04/06 16:37:03	1.3
+++ migrate_ptk.py	2001/04/08 19:18:18	1.4
@@ -107,7 +107,7 @@
             newob = k.__basicnew__()
         else:
             newob = new.instance(k, {})
-        try: newob.id = ob.id
+        try: newob.id = ob.getId()
         except AttributeError: pass
         newob.__dict__.update(ob.__dict__)
         if hasattr(newob, '_objects'):