diff options
author | Magnus Hagander | 2024-04-10 08:13:59 +0000 |
---|---|---|
committer | Magnus Hagander | 2024-04-15 17:31:57 +0000 |
commit | a7b2be02d14331b557e102e7937f5992df83a0c8 (patch) | |
tree | c01b00f3b3f0e4a52a73138061d4928b343ac360 /postgresqleu/util/models.py | |
parent | 3851bda95ca2e54e7d3118c920813de4563d584f (diff) |
Store and use hash of benefit images
Store the hash (md5 is good enough here) of the benefit images, and
maintain it using a trigger. This hash is used to implement
etag-handling for downloads of the image. We don't expect that part to
pay off very well since it's logged in users only, but the hash will be
useful in some upcoming patches, and once we have it implementing the
etag handling is basically free.
Diffstat (limited to 'postgresqleu/util/models.py')
-rw-r--r-- | postgresqleu/util/models.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/postgresqleu/util/models.py b/postgresqleu/util/models.py index 691165b9..8700dc5f 100644 --- a/postgresqleu/util/models.py +++ b/postgresqleu/util/models.py @@ -6,6 +6,7 @@ class Storage(models.Model): key = models.CharField(max_length=16, null=False, blank=False) storageid = models.IntegerField(null=False, blank=False) data = models.BinaryField(null=False, blank=False) + hashval = models.BinaryField(null=False, blank=False) class Meta: unique_together = ( |