rename to one trip

This commit is contained in:
Alexander Laevens
2022-11-26 00:25:22 -07:00
parent 839147e0b0
commit 25e1a42392
207 changed files with 8015 additions and 245 deletions

View File

@@ -0,0 +1,13 @@
from django.contrib.auth.models import AbstractUser
from django.db import models
from api.models import Homegroup
from pathlib import Path
def image_path(instance, fname):
extension = Path(fname).suffix
return f"profile-images/{instance.id}{extension}"
class User(AbstractUser):
homegroup = models.ForeignKey(Homegroup, related_name="users", on_delete=models.SET_NULL, blank=True, null=True)
image = models.ImageField(upload_to=image_path, null=True, blank=True)