summaryrefslogtreecommitdiffstats
path: root/tabellio
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2011-11-11 13:30:45 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2011-11-11 13:30:45 (GMT)
commit3d56779508b1d467590a7b9bc93392d78f57a22c (patch)
treed8dfca28f45d095357ae3e2bd77d6fa07bc0eaf8 /tabellio
parent5f2fdf01e00038d89dc310dc12b2da1b2cf40c28 (diff)
downloadtabellio.pcfdb-3d56779508b1d467590a7b9bc93392d78f57a22c.zip
tabellio.pcfdb-3d56779508b1d467590a7b9bc93392d78f57a22c.tar.gz
tabellio.pcfdb-3d56779508b1d467590a7b9bc93392d78f57a22c.tar.bz2
import topics into documents/dossiers/questions
Diffstat (limited to 'tabellio')
-rw-r--r--tabellio/pcfdb/sync.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py
index 460fb8d..65f4cfa 100644
--- a/tabellio/pcfdb/sync.py
+++ b/tabellio/pcfdb/sync.py
@@ -674,7 +674,9 @@ class SyncFromPcfDbView(BrowserView):
JOIN t_typedoc
ON (t_document.type = t_typedoc.id)
WHERE t_document.st = 'S_INDEXED' AND
- t_typedoc.finet = 't'
+ t_typedoc.finet = 't' AND
+ (t_document.textprovts is not NULL OR
+ t_document.textdefts is not NULL)
%s''' % where_ts)
count = 0
@@ -684,7 +686,7 @@ class SyncFromPcfDbView(BrowserView):
if row is None:
break
count += 1
- (doc_id, doctype, sess, date, no, nodoc, intit, authors, subjects,
+ (doc_id, doctype, sess, date, no, nodoc, intit, authors, topics,
polgroups, image_id) = row
if intit is None:
@@ -714,6 +716,7 @@ class SyncFromPcfDbView(BrowserView):
object.nodoc = nodoc
object.doctype = doctype
object.file_image_id = image_id
+ object.topics = topics
if authors:
authors = [self.get_author_intid(x) for x in authors]
object.authors = [RelationValue(x) for x in authors if x]
@@ -747,7 +750,8 @@ class SyncFromPcfDbView(BrowserView):
cursor.execute('''SELECT t_histo.id, t_histo.st, t_histo.type,
t_histo.sess, t_histo.no, t_histo.intit,
t_histo.auteurs,
- t_histo.curcom, t_histo.comppols
+ t_histo.curcom, t_histo.comppols,
+ t_histo.matiereids
FROM t_histo
WHERE t_histo.intit IS NOT NULL
AND t_histo.type NOT IN ('QA', 'QE', 'QO', 'INTERP')
@@ -759,7 +763,7 @@ class SyncFromPcfDbView(BrowserView):
if row is None:
break
count += 1
- dos_id, state, dostype, sess, no, intit, authors, curcom, polgroups = row
+ dos_id, state, dostype, sess, no, intit, authors, curcom, polgroups, topics = row
print 'dos id:', dos_id
@@ -772,6 +776,7 @@ class SyncFromPcfDbView(BrowserView):
object.session = sess
object.no = no
object.dostype = dostype
+ object.topics = topics
if authors:
authors = [self.get_author_intid(x) for x in authors]
object.authors = [RelationValue(x) for x in authors if x]
@@ -812,7 +817,7 @@ class SyncFromPcfDbView(BrowserView):
cursor.execute('''SELECT t_histo.id, t_histo.st, t_histo.type, t_histo.sess,
t_histo.no, t_histo.intit, t_histo.auteurs,
- t_histo.comppols
+ t_histo.comppols, t_histo.matiereids
FROM t_histo
WHERE t_histo.intit IS NOT NULL
AND t_histo.type IN ('QA', 'QE', 'QO', 'INTERP')
@@ -824,7 +829,7 @@ class SyncFromPcfDbView(BrowserView):
if row is None:
break
count += 1
- dos_id, state, dostype, sess, no, intit, authors, polgroups = row
+ dos_id, state, dostype, sess, no, intit, authors, polgroups, topics = row
print 't_qx/dos id:', dos_id
if not hasattr(self.questions_folder, dos_id):
self.questions_folder.invokeFactory('tabellio.documents.question', dos_id)
@@ -836,6 +841,7 @@ class SyncFromPcfDbView(BrowserView):
object.state = state
object.no = no
object.questype = dostype
+ object.topics = topics
if authors:
authors = [self.get_author_intid(x) for x in authors]