本文整理汇总了Python中mkt.zadmin.models.unmemoized_get_config函数的典型用法代码示例。如果您正苦于以下问题:Python unmemoized_get_config函数的具体用法?Python unmemoized_get_config怎么用?Python unmemoized_get_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unmemoized_get_config函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: context
def context(request, **kw):
statuses = dict((k, unicode(v)) for k, v in amo.STATUS_CHOICES_API.items())
ctx = dict(motd=unmemoized_get_config('mkt_reviewers_motd'),
queue_counts=queue_counts(request),
search_url=reverse('reviewers-search-api'),
statuses=statuses, point_types=amo.REVIEWED_MARKETPLACE)
ctx.update(kw)
return ctx
示例2: motd
def motd(request):
message = unmemoized_get_config("mkt_developers_motd")
form = MOTDForm(request.POST or None, initial={"motd": message})
if request.method == "POST" and form and form.is_valid():
set_config("mkt_developers_motd", form.cleaned_data["motd"])
messages.success(request, _("Changes successfully saved."))
return redirect(reverse("mkt.developers.motd"))
return render(request, "developers/motd.html", {"form": form})
示例3: dashboard
def dashboard(request):
addons, filter = addon_listing(request)
addons = amo.utils.paginate(request, addons, per_page=10)
data = dict(addons=addons, sorting=filter.field, filter=filter,
sort_opts=filter.opts,
motd=unmemoized_get_config('mkt_developers_motd')
)
return render(request, 'developers/apps/dashboard.html', data)
示例4: dashboard
def dashboard(request):
addons, sorting = addon_listing(request)
addons = paginate(request, addons, per_page=10)
data = {
'addons': addons,
'sorting': sorting,
'motd': unmemoized_get_config('mkt_developers_motd')
}
return render(request, 'developers/apps/dashboard.html', data)
示例5: motd
def motd(request):
form = None
motd = unmemoized_get_config('mkt_reviewers_motd')
if acl.action_allowed(request, 'AppReviewerMOTD', 'Edit'):
form = MOTDForm(request.POST or None, initial={'motd': motd})
if form and request.method == 'POST' and form.is_valid():
set_config(u'mkt_reviewers_motd', form.cleaned_data['motd'])
messages.success(request, _('Changes successfully saved.'))
return redirect(reverse('reviewers.apps.motd'))
data = context(request, form=form)
return render(request, 'reviewers/motd.html', data)
示例6: dashboard
def dashboard(request):
addons, sorting = addon_listing(request)
addons = paginate(request, addons, per_page=10)
data = {"addons": addons, "sorting": sorting, "motd": unmemoized_get_config("mkt_developers_motd")}
return render(request, "developers/apps/dashboard.html", data)