From a47f71efc9a7643be548f7f805e162a1942d3db4 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 15 Oct 2024 14:28:30 +0100 Subject: More CSS improvements and wip on profile page - uses dividers between divs which I'm not sure I like - etc --- myuser/models.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'myuser') diff --git a/myuser/models.py b/myuser/models.py index d9f8aba..d0f70ec 100644 --- a/myuser/models.py +++ b/myuser/models.py @@ -3,6 +3,8 @@ from django.contrib.auth.models import PermissionsMixin from django.db import models from django.db.models import BooleanField, CharField, EmailField +from engagements.models import Engagement + class Common(models.Model): date_created = models.DateTimeField(auto_now_add=True) @@ -60,6 +62,7 @@ class TeamUser(AbstractBaseUser, PermissionsMixin): The `has_perm` and `has_module_perms` methods are placeholders that always return `True`, indicating that the user has all permissions. The `is_staff` property is also a placeholder that returns the value of `is_admin`. """ + email = EmailField(verbose_name="email address", max_length=255, unique=True) first_name = CharField(max_length=20, null=True, blank=True) last_name = CharField(max_length=20, null=True, blank=True) @@ -78,6 +81,9 @@ class TeamUser(AbstractBaseUser, PermissionsMixin): def __str__(self): return self.email + def get_all_engagements(self): + return Engagement.objects.filter(officers__id__contains=self.id) + def fullname(self): return f"{self.first_name} {self.last_name}" -- cgit v1.2.3