コード例 #1
0
ファイル: models.py プロジェクト: MorphiusInfotech/formspree
 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))
コード例 #2
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))