fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes #2035: Minor cite formatting issues.
[wolnelektury.git]
/
apps
/
chunks
/
models.py
diff --git
a/apps/chunks/models.py
b/apps/chunks/models.py
index
ef244eb
..
4ab846b
100644
(file)
--- a/
apps/chunks/models.py
+++ b/
apps/chunks/models.py
@@
-1,6
+1,6
@@
from django.core.cache import cache
from django.db import models
from django.core.cache import cache
from django.db import models
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _
, get_language
class Chunk(models.Model):
class Chunk(models.Model):
@@
-20,12
+20,13
@@
class Chunk(models.Model):
def __unicode__(self):
return self.key
def __unicode__(self):
return self.key
- def cache_key(self):
- return 'chunk_' + self.key
+ @staticmethod
+ def cache_key(key):
+ return 'chunk/%s/%s' % (key, get_language())
def save(self, *args, **kwargs):
ret = super(Chunk, self).save(*args, **kwargs)
def save(self, *args, **kwargs):
ret = super(Chunk, self).save(*args, **kwargs)
- cache.delete(self.cache_key())
+ cache.delete(self.cache_key(
self.key
))
return ret
return ret