From 5f2a0370b7e8349eb366c2afc415c8f65cc06ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 24 Nov 2011 15:52:08 +0100 Subject: [PATCH] sync drafts (#993) --- tabellio/pcfdb/sync.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index 4b4044c..403f946 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -825,8 +825,10 @@ class SyncFromPcfDbView(BrowserView): where_ts = cursor.mogrify('AND t_document.ts > %s', (timestamp,)) cursor.execute('''SELECT t_document.id, type, sess, date, no, nodoc, anx, intit, auteurs, matiereids, comppols, imageid, - textdefts, textprovts + t_file.imagestoreid, textdefts, textprovts FROM t_document + LEFT JOIN t_file + ON (t_document.text1id = t_file.fileid) JOIN t_typedoc ON (t_document.type = t_typedoc.id) WHERE t_document.st = 'S_INDEXED' AND @@ -844,7 +846,7 @@ class SyncFromPcfDbView(BrowserView): break count += 1 (doc_id, doctype, sess, date, no, nodoc, anx, intit, authors, topics, - polgroups, image_id, textprovts, textdefts) = row + polgroups, image_id, text1id, textprovts, textdefts) = row if intit is None: intit = {'RAPP': u'Rapport', @@ -884,6 +886,8 @@ class SyncFromPcfDbView(BrowserView): elif textprovts: object.final_version = False object.publication_date = DateTime(textprovts.isoformat()) + if not object.file_image_id and text1id: + object.file_image_id = text1id if authors: authors = [self.get_author_intid(x) for x in authors] object.authors = [RelationValue(x) for x in authors if x]