[gen] Added the posssibility to create a custom widget that displays an icon for generating a doc from a pod field, but with an additional param allowing to customize the pod context.

This commit is contained in:
Gaetan Delannay 2013-06-20 17:35:52 +02:00
parent e83f0f3815
commit 086f93e845
7 changed files with 16 additions and 3 deletions

View file

@ -2435,8 +2435,17 @@ class Pod(Type):
sortBy=sortKey, sortOrder=sortOrder, filterKey=filterKey,
filterValue=filterValue, maxResults='NO_LIMIT')
podContext['objects'] = [o.appy() for o in objs['objects']]
# Add the field-specific context if present.
if specificContext:
podContext.update(specificContext)
# If a custom param comes from the request, add it to the context. A
# custom param must have format "name:value". Custom params override any
# other value in the request, including values from the field-specific
# context.
customParams = rq.get('customParams', None)
if customParams:
paramsDict = eval(customParams)
podContext.update(paramsDict)
# Define a potential global styles mapping
if callable(self.stylesMapping):
stylesMapping = self.callMethod(obj, self.stylesMapping)