[CalendarServer-changes] [6012] CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore /postgres.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 9 10:11:55 PDT 2010


Revision: 6012
          http://trac.macosforge.org/projects/calendarserver/changeset/6012
Author:   glyph at apple.com
Date:     2010-08-09 10:11:55 -0700 (Mon, 09 Aug 2010)
Log Message:
-----------
make PropertyStore getitem more specific

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py

Modified: CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py
===================================================================
--- CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py	2010-08-09 17:09:49 UTC (rev 6011)
+++ CalendarServer/branches/users/glyph/sql-store/txcaldav/calendarstore/postgres.py	2010-08-09 17:11:55 UTC (rev 6012)
@@ -152,8 +152,8 @@
     def _getitem_uid(self, key, uid):
         rows = self._txn.execSQL(
             "select VALUE from RESOURCE_PROPERTY where "
-            "NAME = %s and VIEWER_UID = %s",
-            [key.toString(), uid])
+            "RESOURCE_ID = %s and NAME = %s and VIEWER_UID = %s",
+            [self._resourceID, key.toString(), uid])
         if not rows:
             raise KeyError(key)
         return WebDAVDocument.fromString(rows[0][0]).root_element
@@ -463,6 +463,10 @@
         return
 
 
+    def remove(self):
+        return
+
+
     def allRecords(self):
         return []
 
@@ -481,12 +485,7 @@
     def addOrUpdateRecord(self, record):
         return
 
-#        self._db_execute("""insert or replace into INVITE (INVITEUID, USERID, PRINCIPALURL, NAME, ACCESS, STATE, SUMMARY)
-#            values (:1, :2, :3, :4, :5, :6, :7)
-#            """, record.inviteuid, record.userid, record.principalURL, record.name, record.access, record.state, record.summary,
-#        )
 
-
     def removeRecordForUserID(self, userid):
         return
 
@@ -573,6 +572,16 @@
 #        )
 
 
+class PostgresLegacyIndexEmulator(object):
+    """
+    Emulator for L{twistedcaldv.index.Index} and
+    L{twistedcaldv.index.IndexSchedule}.
+    """
+
+    def __init__(self, calendar):
+        self.calendar = calendar
+
+
 class PostgresCalendar(object):
 
     implements(ICalendar)
@@ -593,7 +602,10 @@
     def retrieveOldInvites(self):
         return PostgresLegacyInvitesEmulator(self)
 
+    def retrieveOldIndex(self):
+        return PostgresLegacyIndexEmulator(self)
 
+
     def notifierID(self, label="default"):
         return None
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100809/a3b86f19/attachment-0001.html>


More information about the calendarserver-changes mailing list