sync drafts (#993)

This commit is contained in:
Frédéric Péters 2011-11-24 15:52:08 +01:00
parent 6b1f726798
commit 5f2a0370b7
1 changed files with 6 additions and 2 deletions

View File

@ -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]