Esempio n. 1
0
def remind_accounts_about_events():
    hots = AccountReminding.hots.existing()

    for reminding in hots:
        remind_account_about_events(reminding.account, SingleEvent.future_events.filter(id=reminding.single_event.id))
        reminding.processed()
    return hots
Esempio n. 2
0
def remind_accounts_about_events_on_week_day():
    accounts = Account.objects.extra(where=['reminder_type_state & %s != 0' % REMINDER_TYPES['WEEKDAY']['id']])\
                      .filter(reminder_on_week_day=str(datetime.now().weekday()))
    for account in accounts:
        single_events = account.reminder_single_events.filter(start_time__gte=datetime.now(), start_time__lte=(datetime.now() + timedelta(days=7)))

        if len(single_events) > 0:
            remind_account_about_events(account, single_events)
Esempio n. 3
0
def remind_accounts_about_events():
    hots = AccountReminding.hots.existing()

    for reminding in hots:
        remind_account_about_events(
            reminding.account,
            SingleEvent.future_events.filter(id=reminding.single_event.id))
        reminding.processed()
    return hots
Esempio n. 4
0
def remind_accounts_about_events_on_week_day():
    accounts = Account.objects.extra(where=['reminder_type_state & %s != 0' % REMINDER_TYPES['WEEKDAY']['id']])\
                      .filter(reminder_on_week_day=str(datetime.now().weekday()))
    for account in accounts:
        single_events = account.reminder_single_events.filter(
            start_time__gte=datetime.now(),
            start_time__lte=(datetime.now() + timedelta(days=7)))

        if len(single_events) > 0:
            remind_account_about_events(account, single_events)
Esempio n. 5
0
def remind_accounts_about_events_on_week_day():
    for account in Account.objects.filter(
        reminder_active_type="WEEKDAY", reminder_on_week_day=str(datetime.now().weekday())
    ):
        single_events = account.reminder_single_events.filter(
            start_time__gte=datetime.now(), start_time__lte=(datetime.now() + timedelta(days=7))
        )

        if len(single_events) > 0:
            remind_account_about_events(account, single_events)
Esempio n. 6
0
def remind_preview(request):
    message = remind_account_about_events(
        Account.objects.get(user__email="*****@*****.**"),
        SingleEvent.future_events.all()[0:1]
    )

    return HttpResponse(message)
Esempio n. 7
0
def remind_preview(request):
    message = remind_account_about_events(
        Account.objects.get(user__email="*****@*****.**"),
        SingleEvent.future_events.all()[0:1])

    return HttpResponse(message)