當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。