diff options
author | Magnus Hagander | 2011-06-14 17:48:48 +0000 |
---|---|---|
committer | Magnus Hagander | 2011-06-14 17:48:48 +0000 |
commit | f92709d2a62274bfc4bb4175a635cc4f0113160e (patch) | |
tree | 75d0db79e3077ad84a9a2213ab44d6d8562c965c /pgweb/profserv/models.py | |
parent | d9e26b9518d73e9a385fd387ebeb6dc58b999409 (diff) |
Implement basic varnish purging
This allows all models inherited from PgModel to specify which
URLs to purge by either setting a field or defining a function
called purge_urls, at which point they will be purged whenever
the save signal is fired.
Also implements a form under /admin/purge/ that allows for manual
purging. This should probably be extended in the future to show
the status of the pgq slaves, but that will come later.
Includes a SQL function that posts the expires to a pgq queue. For
a local deployment, this can be replaced with a simple void function
to turn off varnish purging.
Diffstat (limited to 'pgweb/profserv/models.py')
-rw-r--r-- | pgweb/profserv/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pgweb/profserv/models.py b/pgweb/profserv/models.py index 19b125fb..73a663a7 100644 --- a/pgweb/profserv/models.py +++ b/pgweb/profserv/models.py @@ -4,7 +4,7 @@ from django.contrib.auth.models import User from pgweb.core.models import Organisation from pgweb.util.bases import PgModel -class ProfessionalService(models.Model): +class ProfessionalService(PgModel, models.Model): submitter = models.ForeignKey(User, null=False, blank=False) approved = models.BooleanField(null=False, blank=False, default=False) @@ -28,6 +28,7 @@ class ProfessionalService(models.Model): provides_hosting = models.BooleanField(null=False, default=False) interfaces = models.CharField(max_length=512, null=True, blank=True) + purge_urls = ('support/professional_', ) send_notification = True |