本文整理汇总了Python中event.models.Event.featured_events_for_region方法的典型用法代码示例。如果您正苦于以下问题:Python Event.featured_events_for_region方法的具体用法?Python Event.featured_events_for_region怎么用?Python Event.featured_events_for_region使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event.models.Event
的用法示例。
在下文中一共展示了Event.featured_events_for_region方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: remind_account_about_events_with_email
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import featured_events_for_region [as 别名]
def remind_account_about_events_with_email(account, single_events):
featured_events = Event.featured_events_for_region(account.native_region)
similar_events = find_similar_events(
Event.future_events.filter(id__in=single_events.values_list("event_id", flat=True))
)
subject = "Upcoming events from cityfusion"
message = render_to_string(
"accounts/emails/reminder_email.html",
{
"featured_events": featured_events,
"events": single_events,
"similar_events": similar_events,
"STATIC_URL": "/static/",
"advertising_region": account.advertising_region,
"site": "http://%s" % Site.objects.get_current().domain,
},
)
msg = EmailMessage(subject, message, "[email protected]", [account.reminder_email])
msg.content_subtype = "html"
msg.send()
return message
示例2: inform_account_about_events_with_tag_with_email
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import featured_events_for_region [as 别名]
def inform_account_about_events_with_tag_with_email(account, events, tags_in_venues):
featured_events = Event.featured_events_for_region(account.native_region)[:4]
similar_events = find_similar_events(events)
subject = "New Events in cityfusion"
message = render_to_string(
"accounts/emails/in_the_loop_email.html",
{
"featured_events": featured_events,
"events": events,
"similar_events": similar_events,
"STATIC_URL": "/static/",
"site": "http://%s" % Site.objects.get_current().domain,
"tags_in_venues": tags_in_venues,
"advertising_region": account.advertising_region,
},
)
msg = EmailMessage(subject, message, "[email protected]", [account.in_the_loop_email])
msg.content_subtype = "html"
msg.send()
return message
示例3: remind_account_about_events_with_email
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import featured_events_for_region [as 别名]
def remind_account_about_events_with_email(account, single_events):
if account.reminder_email:
featured_events = Event.featured_events_for_region(account.native_region)[0:4]
similar_events = find_similar_events(
Event.future_events.filter(id__in=single_events.values_list("event_id", flat=True))
)
subject = "Upcoming events from cityfusion"
message = render_to_string('accounts/emails/reminder_email.html', {
"featured_events": featured_events,
"events": single_events,
"similar_events": similar_events,
"STATIC_URL": "/static/",
"advertising_region": account.advertising_region,
"site": "http://%s" % Site.objects.get_current().domain
})
try:
msg = EmailMessage(subject,
message,
"[email protected]",
[account.reminder_email])
msg.content_subtype = 'html'
msg.send()
except:
logger.error("Invalid email %s" % account.reminder_email)
return message
else:
return ""
示例4: remind_account_about_deleted_events_with_email
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import featured_events_for_region [as 别名]
def remind_account_about_deleted_events_with_email(account, single_events):
if account.reminder_email:
featured_events = Event.featured_events_for_region(account.native_region)[:4]
subject = 'Deleted events from cityfusion'
message = render_to_string('accounts/emails/reminder_deleted_event_email.html', {
"featured_events": featured_events,
"events": single_events,
"STATIC_URL": "/static/",
"advertising_region": account.advertising_region,
"site": "http://%s" % Site.objects.get_current().domain
})
try:
msg = EmailMessage(subject,
message,
"[email protected]",
[account.reminder_email])
msg.content_subtype = 'html'
msg.send()
except:
logger.error("Invalid email %s" % account.reminder_email)
return message
else:
return ""
示例5: remind_account_about_deleted_events_with_email
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import featured_events_for_region [as 别名]
def remind_account_about_deleted_events_with_email(account, single_events):
featured_events = Event.featured_events_for_region(account.native_region)
subject = "Deleted events from cityfusion"
message = render_to_string(
"accounts/emails/reminder_deleted_event_email.html",
{
"featured_events": featured_events,
"events": single_events,
"STATIC_URL": "/static/",
"advertising_region": account.advertising_region,
"site": "http://%s" % Site.objects.get_current().domain,
},
)
print message
msg = EmailMessage(subject, message, "[email protected]", [account.reminder_email])
msg.content_subtype = "html"
msg.send()
return message