We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe I'm missing something obvious, but is there a way to clear the cache after saving the instance directly, instead of via the form?
We have one singleton that's updated automatically via a worker task, so doesn't go through the form. If I run this:
sgtn = MySingleton.get_solo() sgtn.name = 'New Value' sgtn.save()
and then I query the result using MySingleton.get_solo().name I get the previous value.
MySingleton.get_solo().name
I tried overriding the save method like this:
def save(self, *args, **kwargs): self.clear_cache() super().save(*args, **kwargs)
But that didn't work either. Is there a way of configuring this? Seems like quite a reasonable use case if not.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Maybe I'm missing something obvious, but is there a way to clear the cache after saving the instance directly, instead of via the form?
We have one singleton that's updated automatically via a worker task, so doesn't go through the form. If I run this:
and then I query the result using
MySingleton.get_solo().name
I get the previous value.I tried overriding the save method like this:
But that didn't work either. Is there a way of configuring this? Seems like quite a reasonable use case if not.
The text was updated successfully, but these errors were encountered: