From 94ba9733d1a732eff9b157607edea46dc7932513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 23 Nov 2011 14:36:44 +0100 Subject: [PATCH] sync commission secretariat --- tabellio/pcfdb/sync.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tabellio/pcfdb/sync.py b/tabellio/pcfdb/sync.py index 2b0d06c..77c66c5 100644 --- a/tabellio/pcfdb/sync.py +++ b/tabellio/pcfdb/sync.py @@ -20,6 +20,7 @@ from zope import component from zope.app.intid.interfaces import IIntIds from z3c.relationfield import RelationValue from zope.i18n.locales import locales +from plone.app.textfield.value import RichTextValue import transaction @@ -698,6 +699,34 @@ class SyncFromPcfDbView(BrowserView): firstname, lastname, 'S_MINISTRE'))) minist_cursor.close() + secr_cursor = self.db_connection.cursor() + secr_cursor.execute('''SELECT titre, sexe, nom, prenom, adjoint, email, attrib + FROM t_comsecr + WHERE comid = %(id)s + ORDER BY adjoint, nom''', {'id': com_id}) + s = ['\n') + object.secretariat = RichTextValue(raw=''.join(s), + mimeType='text/html', + outputMimeType='text/x-html-safe') + secr_cursor.close() + notify(ObjectModifiedEvent(object)) if object.active: self.publish(object)