improve changeset cache key
This commit is contained in:
parent
ceafc2e1cb
commit
9030351461
2 changed files with 2 additions and 2 deletions
|
@ -423,7 +423,7 @@ class ChangeSet(models.Model):
|
|||
|
||||
@property
|
||||
def cache_key_by_changes(self):
|
||||
return ':'.join((str(self.pk), MapUpdate.cache_key(), self.last_change_cache_key))
|
||||
return ':'.join(('editor:changeset', str(self.pk), MapUpdate.cache_key(), self.last_change_cache_key))
|
||||
|
||||
def get_absolute_url(self):
|
||||
if self.pk is None:
|
||||
|
|
|
@ -170,7 +170,7 @@ def changeset_detail(request, pk):
|
|||
'active': active,
|
||||
}
|
||||
|
||||
cache_key = 'editor:changeset_view_data:'+changeset.cache_key_by_changes
|
||||
cache_key = changeset.cache_key_by_changes + ':view_data'
|
||||
changed_objects_data = cache.get(cache_key)
|
||||
if changed_objects_data:
|
||||
ctx['changed_objects'] = changed_objects_data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue