base.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def render_row_actions(self, datum, pull_right=True, row=False):
        """Renders the actions specified in ``Meta.row_actions`` using the
        current row data. If `row` is True, the actions are rendered in a row
        of buttons. Otherwise they are rendered in a dropdown box.
        """
        if row:
            template_path = self._meta.row_actions_row_template
        else:
            template_path = self._meta.row_actions_dropdown_template

        row_actions_template = template.loader.get_template(template_path)
        bound_actions = self.get_row_actions(datum)
        extra_context = {"row_actions": bound_actions,
                         "row_id": self.get_object_id(datum),
                         "pull_right": pull_right}
        context = template.RequestContext(self.request, extra_context)
        return row_actions_template.render(context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号