Commit c1854509 authored by Sebastien Robin's avatar Sebastien Robin

replace object by object_id


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1207 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e89c560
...@@ -262,7 +262,7 @@ class Signature(Folder,SyncCode): ...@@ -262,7 +262,7 @@ class Signature(Folder,SyncCode):
# XXX This may be a problem, if the document is changed # XXX This may be a problem, if the document is changed
# during a synchronization # during a synchronization
self.setLastSynchronizationDate(DateTime()) self.setLastSynchronizationDate(DateTime())
self.getParent().removeRemainingObject(self.getObject()) self.getParent().removeRemainingObjectId(self.getId())
if status == self.NOT_SYNCHRONIZED: if status == self.NOT_SYNCHRONIZED:
self.setTempXML(None) self.setTempXML(None)
self.setPartialXML(None) self.setPartialXML(None)
...@@ -1007,32 +1007,32 @@ class Subscription(Folder, SyncCode): ...@@ -1007,32 +1007,32 @@ class Subscription(Folder, SyncCode):
conflict_list += signature.getConflictList() conflict_list += signature.getConflictList()
return conflict_list return conflict_list
def getRemainingObjectList(self): def getRemainingObjectIdList(self):
""" """
We should now wich objects should still We should now wich objects should still
synchronize synchronize
""" """
return getattr(self,'remaining_object_list',None) return getattr(self,'remaining_object_id_list',None)
def setRemainingObjectList(self, value): def setRemainingObjectIdList(self, value):
""" """
We should now wich objects should still We should now wich objects should still
synchronize synchronize
""" """
setattr(self,'remaining_object_list',value) setattr(self,'remaining_object_id_list',value)
def removeRemainingObject(self, object): def removeRemainingObjectId(self, object_id):
""" """
We should now wich objects should still We should now wich objects should still
synchronize synchronize
""" """
remaining_object_list = self.getRemainingObjectList() remaining_object_list = self.getRemainingObjectIdList()
if remaining_object_list is not None: if remaining_object_list is not None:
new_list = [] new_list = []
for o in remaining_object_list: for o in remaining_object_list:
if o != object: if o != object_id:
new_list.append(o) new_list.append(o)
self.setRemainingObjectList(new_list) self.setRemainingObjectIdList(new_list)
# def getCurrentObject(self): # def getCurrentObject(self):
# """ # """
...@@ -1059,4 +1059,4 @@ class Subscription(Folder, SyncCode): ...@@ -1059,4 +1059,4 @@ class Subscription(Folder, SyncCode):
o.setStatus(self.NOT_SYNCHRONIZED) o.setStatus(self.NOT_SYNCHRONIZED)
o.setPartialXML(None) o.setPartialXML(None)
o.setTempXML(None) o.setTempXML(None)
self.setRemainingObjectList(None) self.setRemainingObjectIdList(None)
...@@ -556,9 +556,11 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -556,9 +556,11 @@ class XMLSyncUtilsMixin(SyncCode):
local_gid_list = [] local_gid_list = []
syncml_data = '' syncml_data = ''
if subscriber.getRemainingObjectList() is None: if subscriber.getRemainingObjectIdList() is None:
object_list = domain.getObjectList() object_list = domain.getObjectList()
subscriber.setRemainingObjectList(object_list) object_id_list = map(lambda x: x.id,object_list)
LOG('getSyncMLData, object_id_list',0,object_id_list)
subscriber.setRemainingObjectIdList(object_id_list)
#object_gid = domain.getGidFromObject(object) #object_gid = domain.getGidFromObject(object)
local_gid_list = map(lambda x: domain.getGidFromObject(x),object_list) local_gid_list = map(lambda x: domain.getGidFromObject(x),object_list)
...@@ -578,7 +580,8 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -578,7 +580,8 @@ class XMLSyncUtilsMixin(SyncCode):
#for object in domain.getObjectList(): #for object in domain.getObjectList():
for object in subscriber.getRemainingObjectList(): for object_id in subscriber.getRemainingObjectIdList():
object = subscriber.getDestination()._getOb(object_id)
status = self.SENT status = self.SENT
#gid_generator = getattr(object,domain.getGidGenerator(),None) #gid_generator = getattr(object,domain.getGidGenerator(),None)
object_gid = domain.getGidFromObject(object) object_gid = domain.getGidFromObject(object)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment