From 1c3baa46c90841487eb437c156f92f738c9c1fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 30 Nov 2011 22:37:43 +0100 Subject: [PATCH] keep two different counts in deputies --- tabellio/pcfdb/sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index 60d0996..fbf2ccc 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -475,6 +475,8 @@ class SyncFromPcfDbView(BrowserView): notify(ObjectModifiedEvent(object)) self.publish(object) + previous_count = count + # currently active deputies cursor.execute('''SELECT t_pers.id, t_pers.nom, prenom, sexe, datenaiss, t_pers.addrpriv, t_pers.addrprof1, t_pers.addrprof2, @@ -490,6 +492,7 @@ class SyncFromPcfDbView(BrowserView): t_parl.arrond = t_arrond.id %s''' % where_ts) + count = 0 polgroup_ids = {} while True: row = cursor.fetchone() @@ -519,7 +522,7 @@ class SyncFromPcfDbView(BrowserView): self.publish(object) cursor.close() - return count + return '%s|%s' % (count, previous_count) def set_person_functions(self, object, pers): cursor = self.db_connection.cursor()