summaryrefslogtreecommitdiffstats
path: root/tabellio/pcfdb/sync.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-11-16 18:50:44 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-11-16 18:50:44 (GMT)
commit05a86149b9158e9702ac6d0a053ad7ee39f37d25 (patch)
treed40c6dd4c83d93dba080597d18bf441d0247dd75 /tabellio/pcfdb/sync.py
parent28363088fee6ee68145ed7f5044b3f3bfedaeefd (diff)
downloadtabellio.pcfdb-05a86149b9158e9702ac6d0a053ad7ee39f37d25.zip
tabellio.pcfdb-05a86149b9158e9702ac6d0a053ad7ee39f37d25.tar.gz
tabellio.pcfdb-05a86149b9158e9702ac6d0a053ad7ee39f37d25.tar.bz2
import final version and publication date attributes
Diffstat (limited to 'tabellio/pcfdb/sync.py')
-rw-r--r--tabellio/pcfdb/sync.py11
1 files changed, 9 insertions, 2 deletions
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]