def start(self, context, request, appstruct, **kw):
artists, new_artists = extract_artists(
appstruct.pop('artists', []), request)
directors, new_directors = extract_artists(
appstruct.pop('directors', []),
request, is_directors=True)
appstruct.pop('artists_ids')
appstruct.pop('directors_ids')
if appstruct.get('picture', None) is not None and \
OBJECT_DATA in appstruct['picture']:
appstruct['picture'] = appstruct['picture'][OBJECT_DATA]
if not getattr(appstruct['picture'], '__name__', None):
appstruct['picture'].__name__ = 'picture'
context.set_metadata(appstruct)
context.set_data(appstruct)
context.setproperty('artists', artists)
context.setproperty('directors', directors)
context.modified_at = datetime.datetime.now(tz=pytz.UTC)
context.reindex()
objects = [context]
objects.extend(new_artists)
objects.extend(new_directors)
request.registry.notify(ActivityExecuted(self, objects, get_current()))
return {}
评论列表
文章目录