You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add enhancement that allows fragment caching to be cleared when a page is edited and saved.
Possible code to use:
def save(self, *args, **kwargs):
"""Create a template fragment key.
Then delete the key."""
key = make_template_fragment_key(
" <-- name of our template fragment --> ",
[self.id]
)
cache.delete(key)
return super().save(*args, **kwargs)
``
The text was updated successfully, but these errors were encountered:
Add enhancement that allows fragment caching to be cleared when a page is edited and saved.
Possible code to use:
The text was updated successfully, but these errors were encountered: