rename cache_key→current_cache_key

This commit is contained in:
Laura Klünder 2017-10-23 22:49:45 +02:00
parent 2124b4a536
commit 82fc9f2264
6 changed files with 10 additions and 6 deletions

View file

@ -34,8 +34,12 @@ class MapUpdate(models.Model):
cache.set('mapdata:last_update', (last_update.pk, last_update.datetime), 900)
return last_update.pk, last_update.datetime
@property
def cache_key(self):
return int_to_base36(self.pk)+'_'+int_to_base36(int(make_naive(self.datetime).timestamp()))
@classmethod
def cache_key(cls):
def current_cache_key(cls):
pk, dt = cls.last_update()
return int_to_base36(pk)+'_'+int_to_base36(int(make_naive(dt).timestamp()))