[CalendarServer-changes] [9287] CalendarServer/branches/users/glyph/uuid-normalize/txdav/common/ datastore/sql.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu May 24 13:34:12 PDT 2012
Revision: 9287
http://trac.macosforge.org/projects/calendarserver/changeset/9287
Author: glyph at apple.com
Date: 2012-05-24 13:34:12 -0700 (Thu, 24 May 2012)
Log Message:
-----------
include notification home
Modified Paths:
--------------
CalendarServer/branches/users/glyph/uuid-normalize/txdav/common/datastore/sql.py
Modified: CalendarServer/branches/users/glyph/uuid-normalize/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/uuid-normalize/txdav/common/datastore/sql.py 2012-05-24 20:34:09 UTC (rev 9286)
+++ CalendarServer/branches/users/glyph/uuid-normalize/txdav/common/datastore/sql.py 2012-05-24 20:34:12 UTC (rev 9287)
@@ -4056,8 +4056,8 @@
@param t: the transaction to normalize all the UUIDs in.
@type t: L{CommonStoreTransaction}
- @param homeType: The type of home to scan; ECALENDARTYPE or
- EADDRESSBOOKTYPE.
+ @param homeType: The type of home to scan, L{ECALENDARTYPE},
+ L{EADDRESSBOOKTYPE}, or L{ENOTIFICATIONTYPE}.
@type homeType: C{int}
@return: a L{Deferred} which fires with C{None} when the UUID normalization
@@ -4065,7 +4065,8 @@
"""
from txdav.caldav.datastore.util import fixOneCalendarHome
homeTable = {EADDRESSBOOKTYPE: schema.ADDRESSBOOK_HOME,
- ECALENDARTYPE: schema.CALENDAR_HOME}[homeType]
+ ECALENDARTYPE: schema.CALENDAR_HOME,
+ ENOTIFICATIONTYPE: schema.NOTIFICATION_HOME}[homeType]
allUIDs = yield Select([homeTable.OWNER_UID],
From=homeTable,
@@ -4130,10 +4131,12 @@
@param column: the column to uppercase. Note
@type column: L{ColumnSyntax}
- @return: A L{Deferred} that will fire when the upper-casing of the given
- column has completed.
+ @return: A L{Deferred} that will fire when the UUID normalization of the
+ given column has completed.
"""
tableModel = column.model.table
+ # Get a primary key made of column syntax objects for querying and
+ # comparison later.
pkey = [ColumnSyntax(columnModel)
for columnModel in tableModel.primaryKey]
for row in (yield Select([column] + pkey,
@@ -4143,6 +4146,8 @@
after = normalizeUUIDOrNot(before)
if after != before:
where = _AndNothing
+ # Build a where clause out of the primary key and the parts of the
+ # primary key that were found.
for pkeycol, pkeypart in zip(pkeyparts, pkey):
where = where.And(pkeycol == pkeypart)
yield Update({column: after}, Where=where).on(txn)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120524/3a0be0c5/attachment-0001.html>
More information about the calendarserver-changes
mailing list