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]