コード例 #1
0
 def wrapper(view, context, model, name):
     # `view` is current administrative view
     # `context` is instance of jinja2.runtime.Context
     # `model` is model instance
     # `name` is property name
     if hasattr(model.__class__, name):
         data = getattr(model, name)
         if data:
             return markup(func(data) or '')
     return ''
コード例 #2
0
 def wrapper(view, context, model, name):
     # `view` is current administrative view
     # `context` is instance of jinja2.runtime.Context
     # `model` is model instance
     # `name` is property name
     return markup(func(model) or '')