base.py 文件源码

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

项目:mos-horizon 作者: Mirantis 项目源码 文件源码
def render(self):
        """Renders the tab to HTML using the
        :meth:`~horizon.tabs.Tab.get_context_data` method and
        the :meth:`~horizon.tabs.Tab.get_template_name` method.

        If :attr:`~horizon.tabs.Tab.preload` is ``False`` and ``force_load``
        is not ``True``, or
        either :meth:`~horizon.tabs.Tab.allowed` or
        :meth:`~horizon.tabs.Tab.enabled` returns ``False`` this method will
        return an empty string.
        """
        if not self.load:
            return ''
        try:
            context = self.data
        except exceptions.Http302:
            raise
        except Exception:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            raise six.reraise(TemplateSyntaxError, exc_value, exc_traceback)
        return render_to_string(self.get_template_name(self.request), context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号