本文整理汇总了Python中subscription.models.Subscription.is_subscription_over方法的典型用法代码示例。如果您正苦于以下问题:Python Subscription.is_subscription_over方法的具体用法?Python Subscription.is_subscription_over怎么用?Python Subscription.is_subscription_over使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription.models.Subscription
的用法示例。
在下文中一共展示了Subscription.is_subscription_over方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: base_context
# 需要导入模块: from subscription.models import Subscription [as 别名]
# 或者: from subscription.models.Subscription import is_subscription_over [as 别名]
def base_context(request, company_id):
Subscription.is_subscription_almost_over(request.user)
Subscription.is_subscription_over(request.user)
actions = Action.objects.filter(status=g.WAITING, _for=request.user.email)
for a in actions:
if a.what == "invitation":
a.data = json.loads(a.data)
#if get_language() == "sl-si":
# accept_url = "sprejmi-povabilo-v-skupino/kljuc=%s" % (a.reference)
# decline_url = "zavrni-povabilo-v-skupino/kljuc=%s" % (a.reference)
# a.accept_url = settings.SITE_URL + settings.URL_PREFIX + accept_url
# a.decline_url = settings.SITE_URL + settings.URL_PREFIX + decline_url
#else:
accept_url = "accept-group-invitation/key=%s" % (a.reference)
decline_url = "decline-group-invitation/key=%s" % (a.reference)
a.accept_url = settings.SITE_URL + settings.URL_PREFIX + accept_url
a.decline_url = settings.SITE_URL + settings.URL_PREFIX + decline_url
# user_groups = request.user.get_user_groups()
"""
try:
user_profile = UserProfile.objects.get(user=request.user)
except UserProfile.DoesNotExist:
user_profile = None
"""""
context = {
'bluser': request.user,
# 'user_profile': user_profile,
'GOOGLE_API': settings.GOOGLE_API,
'actions': actions,
'subscription_link': reverse('subscription:new'),
# json values
# settings, config
'title': "", # will be overwritten by javascript
'language': get_user_value(request.user, "language"),
'clock_range': get_user_value(request.user, "clock_range"),
'site_title': g.SITE_TITLE,
'group_notes_keepalive': g.GROUP_NOTES_KEEPALIVE,
'date_format': g.DATE_FORMATS[get_user_value(request.user, 'date_format')]['jquery'] if request.user.is_authenticated() else g.DATE_FORMATS[g.DEFAULT_DATE_FORMAT]['jquery'],
'field_lengths': {
'max_notes_size': g.MAX_NOTES_SIZE,
}
}
return context