From ef40db9fa17a8c77b156fd6b08589fae8aba6ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 11 Apr 2012 10:34:44 +0200 Subject: [PATCH] import deputy past and current functions --- themis/importexport/sync.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/themis/importexport/sync.py b/themis/importexport/sync.py index 80df300..beb93fb 100644 --- a/themis/importexport/sync.py +++ b/themis/importexport/sync.py @@ -10,6 +10,7 @@ import transaction from zope.event import notify from zope.lifecycleevent import ObjectAddedEvent, ObjectModifiedEvent from z3c.relationfield import RelationValue +from plone.app.textfield.value import RichTextValue from plone.namedfile.file import NamedBlobImage, NamedBlobFile @@ -72,6 +73,20 @@ class SyncFromThemis(UtilityView): # this will be an url object.picture = NamedBlobImage(urllib2.urlopen(data.get('picture')).read(), filename=data.get('id')) + if data.get('past_functions'): + object.past_functions = RichTextValue( + raw=data.get('past_functions'), + mimeType='text/plain', + outputMimeType='text/x-html-safe') + else: + object.past_functions = None + if data.get('current_functions'): + object.current_functions = RichTextValue( + raw=data.get('current_functions'), + mimeType='text/plain', + outputMimeType='text/x-html-safe') + else: + object.current_functions = None for address in ('private_address', 'work_address', 'work_address_2'): if not data.get(address): continue