From 05a86149b9158e9702ac6d0a053ad7ee39f37d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 16 Nov 2011 19:50:44 +0100 Subject: [PATCH] import final version and publication date attributes --- tabellio/pcfdb/sync.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index 25f1f72..22c6335 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -715,7 +715,8 @@ class SyncFromPcfDbView(BrowserView): if timestamp: where_ts = cursor.mogrify('AND t_document.ts > %s', (timestamp,)) cursor.execute('''SELECT t_document.id, type, sess, date, no, nodoc, - intit, auteurs, matiereids, comppols, imageid + intit, auteurs, matiereids, comppols, imageid, + textdefts, textprovts FROM t_document JOIN t_typedoc ON (t_document.type = t_typedoc.id) @@ -733,7 +734,7 @@ class SyncFromPcfDbView(BrowserView): break count += 1 (doc_id, doctype, sess, date, no, nodoc, intit, authors, topics, - polgroups, image_id) = row + polgroups, image_id, textprovts, textdefts) = row if intit is None: intit = {'RAPP': u'Rapport', @@ -763,6 +764,12 @@ class SyncFromPcfDbView(BrowserView): object.doctype = doctype object.file_image_id = image_id object.topics = topics + if textdefts: + object.final_version = True + object.publication_date = textdefts + elif textprovts: + object.final_version = False + object.publication_date = textprovts if authors: authors = [self.get_author_intid(x) for x in authors] object.authors = [RelationValue(x) for x in authors if x]