1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 12:59:36 +02:00
This commit is contained in:
Sean Morley 2024-07-18 11:07:24 -04:00
parent 7051fa749e
commit c723d2836d
5 changed files with 44 additions and 3 deletions

View file

@ -3,6 +3,7 @@ from django.db import models
from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import ArrayField
from django.forms import ValidationError
from django_resized import ResizedImageField
ADVENTURE_TYPES = [
('visited', 'Visited'),
@ -28,7 +29,7 @@ class Adventure(models.Model):
description = models.TextField(blank=True, null=True)
rating = models.FloatField(blank=True, null=True)
link = models.URLField(blank=True, null=True)
image = models.ImageField(null=True, blank=True, upload_to='images/')
image = ResizedImageField(force_format="WEBP", quality=75, null=True, blank=True, upload_to='images/')
date = models.DateField(blank=True, null=True)
is_public = models.BooleanField(default=False)
longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True)