Commit Graph

8 Commits

Author SHA1 Message Date
0a93c65f20 Purge /community/ when changing a survey
Without this only the survey result page is purged, not the actual
survey form on the main page.
2016-12-14 15:25:02 +01:00
217f9ef62a Fix model warnings and deprecations
1. ForeignKey with unique -> OneToOneField
2. IPAddressField -> GenericIPAddressField
3. Fix fields with default=datetime.now() which gives server start time,
   not the insert time (clearly this default was never used, and the
   field was always explicitly set, but it should still not be incorrectly
   defined)
2016-05-14 19:49:12 +02:00
8058accee0 Get rid of PgModel, replacing it with simple signals
We were already using signals for everything except delete, and even
in our old version of django the delete signal exists (it didn't exist
when this code was first written).

Django doesn't really like models to be OOP like this, so keeping PgModel
would cause issues with upcoming changes in django 1.8. Using simple functions
is easier, and the actual functionality is replicated straight off.
2016-03-07 21:41:45 +01:00
756aa6ffbe Clean up imports
Remove unused imports and some other completely unused code.
2014-01-01 15:42:30 +01:00
5bcbf1253e All purge_urls must be rooted, since we add ^ at the beginning 2011-11-27 13:31:20 +01:00
6b621f5ec7 Add migration script for surveys
In passing, make answers up to 500 characters, because that's required
to perform the migration of existing ones...
2011-08-16 13:58:03 +02:00
f92709d2a6 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.
2011-06-14 19:48:48 +02:00
2f671fe3d6 Add support for surveys 2009-12-28 16:12:44 +01:00