import deputy past and current functions

This commit is contained in:
Frédéric Péters 2012-04-11 10:34:44 +02:00
parent effe331464
commit ef40db9fa1
1 changed files with 15 additions and 0 deletions

View File

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