summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-11-24 14:52:08 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-11-24 14:52:08 (GMT)
commit5f2a0370b7e8349eb366c2afc415c8f65cc06ee8 (patch)
treeceab1f75142dbc112af5676eb566b2aa734ae218
parent6b1f726798183bb01af936d851cb65fe62c6bfdd (diff)
downloadtabellio.pcfdb-5f2a0370b7e8349eb366c2afc415c8f65cc06ee8.zip
tabellio.pcfdb-5f2a0370b7e8349eb366c2afc415c8f65cc06ee8.tar.gz
tabellio.pcfdb-5f2a0370b7e8349eb366c2afc415c8f65cc06ee8.tar.bz2
sync drafts (#993)
-rw-r--r--tabellio/pcfdb/sync.py8
1 files 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]