import final version and publication date attributes

This commit is contained in:
Frédéric Péters 2011-11-16 19:50:44 +01:00
parent 28363088fe
commit 05a86149b9
1 changed files with 9 additions and 2 deletions

View File

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