Commit ff887bd7 authored by Serge S. Koval's avatar Serge S. Koval

Updated documentation.

parent 589a238a
...@@ -79,11 +79,12 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -79,11 +79,12 @@ class BaseModelView(BaseView, ActionsMixin):
two, you can do something like this:: two, you can do something like this::
class MyModelView(BaseModelView): class MyModelView(BaseModelView):
list_formatters = dict(price=lambda m, p: m.price*2) list_formatters = dict(price=lambda c, m, p: m.price*2)
Callback function has following prototype:: Callback function has following prototype::
def formatter(model, name): def formatter(context, model, name):
# context is instance of jinja2.runtime.Context
# model is model instance # model is model instance
# name is property name # name is property name
pass pass
...@@ -673,7 +674,7 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -673,7 +674,7 @@ class BaseModelView(BaseView, ActionsMixin):
Returns value to be displayed in list view Returns value to be displayed in list view
:param context: :param context:
Jinja2 context :py:class:`jinja2.runtime.Context`
:param model: :param model:
Model instance Model instance
:param name: :param name:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment