本文整理汇总了Python中mkt.account.utils.purchase_list函数的典型用法代码示例。如果您正苦于以下问题:Python purchase_list函数的具体用法?Python purchase_list怎么用?Python purchase_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了purchase_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _test
def _test(self, type, exists):
Installed.objects.create(user=self.user, addon=self.app,
install_type=type)
if exists:
eq_(list(purchase_list(self.req, self.user, None)[0].object_list),
[self.app])
else:
assert not purchase_list(self.req, self.user, None)[0].object_list
示例2: user_activity
def user_activity(request, user_id):
"""Shows the user activity page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products, contributions, listing = purchase_list(request, user, None)
is_admin = acl.action_allowed(request, "Users", "Edit")
collections = Collection.objects.filter(author=user_id)
user_items = ActivityLog.objects.for_user(user).exclude(action__in=amo.LOG_HIDE_DEVELOPER)
admin_items = ActivityLog.objects.for_user(user).filter(action__in=amo.LOG_HIDE_DEVELOPER)
amo.log(amo.LOG.ADMIN_VIEWED_LOG, request.amo_user, user=user)
return jingo.render(
request,
"lookup/user_activity.html",
{
"pager": products,
"account": user,
"is_admin": is_admin,
"listing_filter": listing,
"collections": collections,
"contributions": contributions,
"single": bool(None),
"user_items": user_items,
"admin_items": admin_items,
"show_link": False,
},
)
示例3: user_purchases
def user_purchases(request, user_id):
"""Shows the purchase page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
is_admin = acl.action_allowed(request, 'Users', 'Edit')
products = purchase_list(request, user)
return render(request, 'lookup/user_purchases.html',
{'pager': products, 'account': user, 'is_admin': is_admin,
'single': bool(None), 'show_link': False})
示例4: test_contribution_installed_same_app
def test_contribution_installed_same_app(self):
self.user.installed_set.create(
webapp=self.app,
install_type=apps.INSTALL_TYPE_USER)
self.user.contribution_set.create(
webapp=self.app,
type=mkt.CONTRIB_PURCHASE)
eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
示例5: test_ordering
def test_ordering(self):
self.user.installed_set.create(
webapp=self.app,
install_type=apps.INSTALL_TYPE_USER)
app2 = app_factory()
self.user.installed_set.create(
webapp=app2,
install_type=apps.INSTALL_TYPE_USER)
eq_(list(purchase_list(self.req, self.user).object_list),
[app2, self.app])
示例6: purchases
def purchases(request, user_id):
"""Shows the purchase page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products, contributions, listing = purchase_list(request, user, None)
return jingo.render(request, 'acct_lookup/purchases.html',
{'pager': products,
'account': user,
'listing_filter': listing,
'contributions': contributions,
'single': bool(None),
'show_link': False})
示例7: activity
def activity(request, user_id):
"""Shows the user activity page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products, contributions, listing = purchase_list(request, user, None)
collections = Collection.objects.filter(author=user_id)
return jingo.render(request, 'acct_lookup/activity.html',
{'pager': products,
'account': user,
'listing_filter': listing,
'collections': collections,
'contributions': contributions,
'single': bool(None),
'show_link': False})
示例8: purchases
def purchases(request, user_id):
"""Shows the purchase page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products, contributions, listing = purchase_list(request, user, None)
return jingo.render(
request,
"acct_lookup/purchases.html",
{
"pager": products,
"listing_filter": listing,
"contributions": contributions,
"single": bool(None),
"show_link": False,
},
)
示例9: user_activity
def user_activity(request, user_id):
"""Shows the user activity page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products = purchase_list(request, user)
is_admin = acl.action_allowed(request, 'Users', 'Edit')
user_items = ActivityLog.objects.for_user(user).exclude(
action__in=mkt.LOG_HIDE_DEVELOPER)
admin_items = ActivityLog.objects.for_user(user).filter(
action__in=mkt.LOG_HIDE_DEVELOPER)
mkt.log(mkt.LOG.ADMIN_VIEWED_LOG, request.user, user=user)
return render(request, 'lookup/user_activity.html',
{'pager': products, 'account': user, 'is_admin': is_admin,
'single': bool(None),
'user_items': user_items, 'admin_items': admin_items,
'show_link': False})
示例10: user_purchases
def user_purchases(request, user_id):
"""Shows the purchase page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
is_admin = acl.action_allowed(request, "Users", "Edit")
products, contributions, listing = purchase_list(request, user, None)
return jingo.render(
request,
"lookup/user_purchases.html",
{
"pager": products,
"account": user,
"is_admin": is_admin,
"listing_filter": listing,
"contributions": contributions,
"single": bool(None),
"show_link": False,
},
)
示例11: user_activity
def user_activity(request, user_id):
"""Shows the user activity page for another user."""
user = get_object_or_404(UserProfile, pk=user_id)
products, contributions, listing = purchase_list(request, user, None)
is_admin = acl.action_allowed(request, 'Users', 'Edit')
collections = Collection.objects.filter(author=user_id)
user_items = ActivityLog.objects.for_user(user).exclude(
action__in=amo.LOG_HIDE_DEVELOPER)
admin_items = ActivityLog.objects.for_user(user).filter(
action__in=amo.LOG_HIDE_DEVELOPER)
amo.log(amo.LOG.ADMIN_VIEWED_LOG, request.amo_user, user=user)
return jingo.render(request, 'lookup/user_activity.html',
{'pager': products,
'account': user,
'is_admin': is_admin,
'listing_filter': listing,
'collections': collections,
'contributions': contributions,
'single': bool(None),
'user_items': user_items,
'admin_items': admin_items,
'show_link': False})
示例12: test_contribution_chargeback
def test_contribution_chargeback(self):
self.user.contribution_set.create(
webapp=self.app,
type=mkt.CONTRIB_CHARGEBACK)
eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
示例13: test_developer
def test_developer(self):
self.user.installed_set.create(
webapp=self.app,
install_type=apps.INSTALL_TYPE_DEVELOPER)
eq_(list(purchase_list(self.req, self.user).object_list), [self.app])
示例14: test_reviewer
def test_reviewer(self):
self.user.installed_set.create(
webapp=self.app,
install_type=apps.INSTALL_TYPE_REVIEWER)
eq_(list(purchase_list(self.req, self.user).object_list), [])
示例15: test_contribution_purchase
def test_contribution_purchase(self):
self.user.contribution_set.create(
webapp=self.app,
type=mkt.CONTRIB_PURCHASE)
eq_(list(purchase_list(self.req, self.user).object_list), [self.app])