summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-11-21 12:41:48 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-11-21 12:41:48 (GMT)
commite278de7d7cfd23414f338b7a5294842b7a948fc8 (patch)
treea92266d356b3b221b35424b2e223101f06352be1
parentcfcf5691490c76ccec14e9bb4ed154c8b0dfbbb1 (diff)
downloadtabellio.pcfdb-e278de7d7cfd23414f338b7a5294842b7a948fc8.zip
tabellio.pcfdb-e278de7d7cfd23414f338b7a5294842b7a948fc8.tar.gz
tabellio.pcfdb-e278de7d7cfd23414f338b7a5294842b7a948fc8.tar.bz2
sync adoption & moniteur date
-rw-r--r--tabellio/pcfdb/sync.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index de27aa4..b47d9ad 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -789,6 +789,37 @@ class SyncFromPcfDbView(BrowserView):
else:
object.polgroups = []
+ if doctype == 'DECCCF':
+ # for decrets we need to get some additional dates from histo
+ # lines
+ decret_cursor = self.db_connection.cursor()
+ decret_cursor.execute(decret_cursor.mogrify(
+ '''SELECT idhisto
+ FROM t_histoline
+ WHERE doctype = %s
+ AND docno = %s
+ AND docsess = %s''', (doctype, no, sess)))
+ row = decret_cursor.fetchone()
+ if row is not None:
+ idhisto = row[0]
+ decret_cursor.execute(decret_cursor.mogrify(
+ '''SELECT date
+ FROM t_histoline
+ WHERE idhisto = %s
+ AND descr = %s''', (idhisto, u'Envoi à la sanction')))
+ row = decret_cursor.fetchone()
+ if row is not None:
+ object.adoption_date = row[0]
+ decret_cursor.execute(decret_cursor.mogrify(
+ '''SELECT date
+ FROM t_histoline
+ WHERE idhisto = %s
+ AND descr = %s''', (idhisto, u'Publication au Moniteur belge')))
+ row = decret_cursor.fetchone()
+ if row is not None:
+ object.moniteur_date = row[0]
+ decret_cursor.close()
+
notify(ObjectModifiedEvent(object))
self.publish(object)