summaryrefslogtreecommitdiff
path: root/postgresqleu/util/fields.py
AgeCommit message (Collapse)Author
2025-01-13Don't crash trying to render non-existant VAT percentagesMagnus Hagander
The fractional VAT patch did not properly handle the case when the field could actually be NULL.
2024-12-04Support fractional VAT ratesMagnus Hagander
Allow fractional tax rates, up to 6 decimal places. Author: Steve Singer, with some fixes from me Fixes #164
2023-10-27Move UserModelChoiceField to utilMagnus Hagander
This can be useful from more places, so make a generic one.
2022-08-12Unify image rescaling codeMagnus Hagander
There was a lot of copy/paste between two locations for the code we use to rescale images (at this time only speaker photos). Put it all in one function with a parameter instead.
2022-06-26Support higher resolution speaker photosMagnus Hagander
This adds a new field to the speaker model supporting 512x512 sized speaker photos. It also changes the speaker form (as well as the backend form) to accept any size image and resize it into the bounding box of 512x512. There is no reason to force the speaker to do that manually, computers are good at such things. The rezied image will be padded as necessary to the full 512x512 with transparent background, which also means the storage format of the new photos will be PNG in order to support that transparency. Whenever the photo is updated, a downscaled copy will automatically be generated that's 128x128 for backwards compatibilty as well as thumbnailing. There is no interface to independently edit this lower resolution photo. Fixes #15
2020-01-09Make max_length a mandatory field of ImageBinaryFieldMagnus Hagander
Also set the max_length on the speaker photo, which was the only ImageBinaryField that did not already have a max_length set.
2019-10-29Add a widget for inline PDF uploading and storingMagnus Hagander
Similar to the existing one for JPEG images
2019-10-29Validate that uploaded image files are actually jpegMagnus Hagander
This is the files uploaded as tweets. For now, don't bother dealint with size, but make sure it's actually a JPEG even in the backend. Also set the proper accepts tag on the form field, so the browser will only show JPEG images by default.
2019-08-21Add a field+widgets for uploading images into a bytea columnMagnus Hagander
Bypasses the annoying django handling and also doesn't require a special table. PostgreSQL has no problem storing small things inline and toast makes it transparent...
2019-07-10Ensure email addresses are lowercase throughoutMagnus Hagander
At least all email addresses being input by end users should be confverted to lowercase to avoid duplicates. Update existing users, registrations and election candidates to be lowercase, and add constraints to them For things like conference contract addresses that are only set by superusers, we skip the constraints part and let the user take some more responsibility.