[CalendarServer-changes] [10947] CalendarServer/branches/users/gaya/sharedgroups/txdav
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 18 17:19:31 PDT 2013
Revision: 10947
http://trac.calendarserver.org//changeset/10947
Author: gaya at apple.com
Date: 2013-03-18 17:19:31 -0700 (Mon, 18 Mar 2013)
Log Message:
-----------
in CommonHomeChild/AddressBook.loadAllObject() use PropertyStore.forMultipleResourcesWithResourceIDs() instead of PropertyStore.forMultipleResources()
Modified Paths:
--------------
CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/sql.py
CalendarServer/branches/users/gaya/sharedgroups/txdav/common/datastore/sql.py
Modified: CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/sql.py 2013-03-19 00:05:16 UTC (rev 10946)
+++ CalendarServer/branches/users/gaya/sharedgroups/txdav/carddav/datastore/sql.py 2013-03-19 00:19:31 UTC (rev 10947)
@@ -632,14 +632,10 @@
if ownerHomeToDataRowMap:
# Get property stores for all these child resources (if any found)
- #FIXME: this does not load address books that are not fully owned.
- propertyStores = (yield PropertyStore.forMultipleResources(
- home.uid(), home._txn,
- cls._bindSchema.RESOURCE_ID, cls._bindSchema.HOME_RESOURCE_ID,
- home._resourceID
- ))
-
childResourceIDs = [ownerHome._resourceID for ownerHome in ownerHomeToDataRowMap]
+ propertyStores = yield PropertyStore.forMultipleResourcesWithResourceIDs(
+ home.uid(), home._txn, childResourceIDs
+ )
revisions = yield cls._revisionsForResourceIDs(childResourceIDs).on(home._txn, resourceIDs=childResourceIDs)
revisions = dict(revisions)
@@ -661,10 +657,9 @@
setattr(child, attr, value)
child._syncTokenRevision = revisions[child._resourceID]
propstore = propertyStores.get(child._resourceID, None)
- if propstore:
- # We have to re-adjust the property store object to account for possible shared
- # collections as previously we loaded them all as if they were owned
- propstore._setDefaultUserUID(ownerHome.uid())
+ # We have to re-adjust the property store object to account for possible shared
+ # collections as previously we loaded them all as if they were owned
+ propstore._setDefaultUserUID(ownerHome.uid())
yield child._loadPropertyStore(None)
results.append(child)
Modified: CalendarServer/branches/users/gaya/sharedgroups/txdav/common/datastore/sql.py
===================================================================
--- CalendarServer/branches/users/gaya/sharedgroups/txdav/common/datastore/sql.py 2013-03-19 00:05:16 UTC (rev 10946)
+++ CalendarServer/branches/users/gaya/sharedgroups/txdav/common/datastore/sql.py 2013-03-19 00:19:31 UTC (rev 10947)
@@ -3006,16 +3006,12 @@
dataRows = (yield cls._childrenAndMetadataForHomeID.on(home._txn, homeID=home._resourceID))
if dataRows:
-
- # Get property stores for all these child resources (if any found)
- propertyStores = (yield PropertyStore.forMultipleResources(
- home.uid(), home._txn,
- cls._bindSchema.RESOURCE_ID, cls._bindSchema.HOME_RESOURCE_ID,
- home._resourceID
- ))
+ # Get property stores for all these child resources
childResourceIDs = [dataRow[2] for dataRow in dataRows]
+ propertyStores = yield PropertyStore.forMultipleResourcesWithResourceIDs(
+ home.uid(), home._txn, childResourceIDs
+ )
revisions = (yield cls._revisionsForResourceIDs(childResourceIDs).on(home._txn, resourceIDs=childResourceIDs))
- #revisions = (yield cls._revisionsForHomeID.on(home._txn, homeID=home._resourceID))
revisions = dict(revisions)
# Create the actual objects merging in properties
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130318/0594352d/attachment-0001.html>
More information about the calendarserver-changes
mailing list