Hello,

I use virtual attribute access to provide access to my SQL database.
However, I want to use the Rack.newItem facility to create new records
in the database.
But it fails because in virtual mode, an item always exists.
This patch solves the problem, at least for me

--- Rack.py.orig        Mon Jun 26 11:35:25 2000
+++ Rack.py     Wed Jul  5 11:13:04 2000
@@ -125,7 +125,8 @@
 
         # Create a new object, identified by key
 
-        item = self.getItem(key)
+        a = self.loadAttrib
+        item = not a and self.getItem(key) or None
 
         # XXX What if all items potentially exist?
 
@@ -134,7 +135,6 @@
 
         item = self._RawItem(key)
 
-        a = self.loadAttrib
         if not a:
             slot = self._writeableSlot(key)
             slot[SelfKey] = item.aq_base    # strip acquisition
wrapping

comments?

regards,
[EMAIL PROTECTED]

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to