[CalendarServer-changes] [7006] CalendarServer/branches/users/glyph/dalify/txdav/common/datastore/ sql.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Feb 16 06:40:09 PST 2011


Revision: 7006
          http://trac.macosforge.org/projects/calendarserver/changeset/7006
Author:   glyph at apple.com
Date:     2011-02-16 06:40:09 -0800 (Wed, 16 Feb 2011)
Log Message:
-----------
dalify listNotificationObjects

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/dalify/txdav/common/datastore/sql.py

Modified: CalendarServer/branches/users/glyph/dalify/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/dalify/txdav/common/datastore/sql.py	2011-02-16 14:39:58 UTC (rev 7005)
+++ CalendarServer/branches/users/glyph/dalify/txdav/common/datastore/sql.py	2011-02-16 14:40:09 UTC (rev 7006)
@@ -2410,13 +2410,17 @@
         returnValue(results)
 
 
+    _notificationUIDsForHomeQuery = Select(
+        [schema.NOTIFICATION.NOTIFICATION_UID], From=schema.NOTIFICATION,
+        Where=schema.NOTIFICATION.NOTIFICATION_HOME_RESOURCE_ID ==
+        Parameter("resourceID"))
+
+
     @inlineCallbacks
     def listNotificationObjects(self):
         if self._notificationNames is None:
-            rows = yield self._txn.execSQL(
-                "select (NOTIFICATION_UID) from NOTIFICATION "
-                "where NOTIFICATION_HOME_RESOURCE_ID = %s",
-                [self._resourceID])
+            rows = yield self._notificationUIDsForHomeQuery.on(
+                self._txn, resourceID=self._resourceID)
             self._notificationNames = sorted([row[0] for row in rows])
         returnValue(self._notificationNames)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110216/a0e8dcfc/attachment-0001.html>


More information about the calendarserver-changes mailing list