当前位置: 首页>>代码示例>>Python>>正文


Python util.quote方法代码示例

本文整理汇总了Python中xadmin.util.quote方法的典型用法代码示例。如果您正苦于以下问题:Python util.quote方法的具体用法?Python util.quote怎么用?Python util.quote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xadmin.util的用法示例。


在下文中一共展示了util.quote方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: block_nav_toggles

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def block_nav_toggles(self, context, nodes):
        obj = getattr(
            self.admin_view, 'org_obj', getattr(self.admin_view, 'obj', None))
        if obj:
            revisionlist_url = self.admin_view.model_admin_url(
                'revisionlist', quote(obj.pk))
            nodes.append(mark_safe('<a href="%s" class="navbar-toggle pull-right"><i class="fa fa-calendar"></i></a>' % revisionlist_url)) 
开发者ID:stormsha,项目名称:StormOnline,代码行数:9,代码来源:xversion.py

示例2: block_nav_btns

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def block_nav_btns(self, context, nodes):
        obj = getattr(
            self.admin_view, 'org_obj', getattr(self.admin_view, 'obj', None))
        if obj:
            revisionlist_url = self.admin_view.model_admin_url(
                'revisionlist', quote(obj.pk))
            nodes.append(mark_safe('<a href="%s" class="btn btn-default"><i class="fa fa-calendar"></i> <span>%s</span></a>' % (revisionlist_url, _(u'History'))))

# action revision 
开发者ID:stormsha,项目名称:StormOnline,代码行数:11,代码来源:xversion.py

示例3: get_context

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def get_context(self):
        context = super(RevisionListView, self).get_context()

        opts = self.opts
        action_list = [
            {
                "revision": version.revision,
                "url": self.model_admin_url('revision', quote(version.object_id), version.id),
                "version": version
            }
            for version
            in self._reversion_order_version_queryset(Version.objects.get_for_object_reference(
                self.model,
                self.obj.pk,
            ).select_related("revision__user"))
        ]
        context.update({
            'title': _('Change history: %s') % force_text(self.obj),
            'action_list': action_list,
            'model_name': capfirst(force_text(opts.verbose_name_plural)),
            'object': self.obj,
            'app_label': opts.app_label,
            "changelist_url": self.model_admin_url("changelist"),
            "update_url": self.model_admin_url("change", self.obj.pk),
            'opts': opts,
        })
        return context 
开发者ID:stormsha,项目名称:StormOnline,代码行数:29,代码来源:xversion.py

示例4: block_nav_toggles

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def block_nav_toggles(self, context, nodes):
        obj = getattr(
            self.admin_view, 'org_obj', getattr(self.admin_view, 'obj', None))
        if obj:
            revisionlist_url = self.admin_view.model_admin_url(
                'revisionlist', quote(obj.pk))
            nodes.append(mark_safe('<a href="%s" class="navbar-toggle pull-right"><i class="fa fa-time"></i></a>' % revisionlist_url)) 
开发者ID:madre,项目名称:devops,代码行数:9,代码来源:xversion.py

示例5: block_nav_btns

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def block_nav_btns(self, context, nodes):
        obj = getattr(
            self.admin_view, 'org_obj', getattr(self.admin_view, 'obj', None))
        if obj:
            revisionlist_url = self.admin_view.model_admin_url(
                'revisionlist', quote(obj.pk))
            nodes.append(mark_safe('<a href="%s" class="btn btn-default"><i class="fa fa-time"></i> <span>%s</span></a>' % (revisionlist_url, _(u'History')))) 
开发者ID:madre,项目名称:devops,代码行数:9,代码来源:xversion.py

示例6: get_context

# 需要导入模块: from xadmin import util [as 别名]
# 或者: from xadmin.util import quote [as 别名]
def get_context(self):
        context = super(RevisionListView, self).get_context()

        opts = self.opts
        action_list = [
            {
                "revision": version.revision,
                "url": self.model_admin_url('revision', quote(version.object_id), version.id),
                "version": version
            }
            for version
            in self._order_version_queryset(self.revision_manager.get_for_object_reference(
                self.model,
                self.obj.pk,
            ).select_related("revision__user"))
        ]
        context.update({
            'title': _('Change history: %s') % force_str(self.obj),
            'action_list': action_list,
            'model_name': capfirst(force_str(opts.verbose_name_plural)),
            'object': self.obj,
            'app_label': opts.app_label,
            "changelist_url": self.model_admin_url("changelist"),
            "update_url": self.model_admin_url("change", self.obj.pk),
            'opts': opts,
        })
        return context 
开发者ID:madre,项目名称:devops,代码行数:29,代码来源:xversion.py


注:本文中的xadmin.util.quote方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。