Esempio n. 1
0
def increase_monthly_counter(form_id, basedate=None):
    basedate = basedate or datetime.datetime.now()
    month = basedate.month
    key = REDIS_COUNTER_KEY(form_id=form_id, month=month)
    counter = redis_store.incr(key)
    redis_store.expireat(key, unix_time_for_12_months_from_now(basedate))
    return int(counter)
Esempio n. 2
0
def increase_monthly_counter(form_id, basedate=None):
    basedate = basedate or datetime.datetime.now()
    month = basedate.month
    key = REDIS_COUNTER_KEY(form_id=form_id, month=month)
    counter = redis_store.incr(key)
    redis_store.expireat(key, unix_time_for_12_months_from_now(basedate))
    return int(counter)
Esempio n. 3
0
 def increase_monthly_counter(self, basedate=None):
     basedate = basedate or datetime.datetime.now()
     month = basedate.month
     key = MONTHLY_COUNTER_KEY(form_id=self.id, month=month)
     redis_store.incr(key)
     redis_store.expireat(key, unix_time_for_12_months_from_now(basedate))
Esempio n. 4
0
 def increase_monthly_counter(self, basedate=None):
     basedate = basedate or datetime.datetime.now()
     month = basedate.month
     key = MONTHLY_COUNTER_KEY(form_id=self.id, month=month)
     redis_store.incr(key)
     redis_store.expireat(key, unix_time_for_12_months_from_now(basedate))