aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-16 10:36:11 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-16 10:36:11 +0100
commitc0067e3dd35f56ad0cf9452f9ef1e8532b6378b4 (patch)
tree9c834f6f194f0f38046975870c3504d4292ad8f5 /ctrack/register/models.py
parent2b11d0e43378c27b250e93e91b9bdc10346af44e (diff)
added URL field for a simple event
Diffstat (limited to '')
-rw-r--r--ctrack/register/models.py44
1 files changed, 38 insertions, 6 deletions
diff --git a/ctrack/register/models.py b/ctrack/register/models.py
index 932dd69..3ab760e 100644
--- a/ctrack/register/models.py
+++ b/ctrack/register/models.py
@@ -88,14 +88,36 @@ class EventBase(AuditableEventBase):
class ThirdPartyEventMixin(models.Model):
participants = models.ManyToManyField(Person, blank=True)
- location = models.CharField(max_length=100, blank=True)
+ location = models.CharField(
+ max_length=100,
+ blank=True,
+ help_text="If event involved a physical location, indicate here.",
+ )
+
+ class Meta:
+ abstract = True
+
+
+class URLEventMixin(models.Model):
+ url = models.URLField(
+ max_length=400,
+ blank=True,
+ null=True,
+ verbose_name="URL",
+ help_text=(
+ "If recording an email, please link to it here. "
+ "Do not paste the text in the comments box."
+ ),
+ ) # these fuckers can get long with SharePoint
class Meta:
abstract = True
class SingleDateTimeEventMixin(models.Model):
- datetime = models.DateTimeField(blank=False, verbose_name="Date/Time", help_text="DD/MM/YY HH:MM format please!")
+ datetime = models.DateTimeField(
+ blank=False, verbose_name="Date/Time", help_text="DD/MM/YY HH:MM format please!"
+ )
class Meta:
abstract = True
@@ -124,19 +146,29 @@ class CAFMixin(models.Model):
class ResponseRequiredMixin(models.Model):
- requested_response_date = models.DateField(blank=True, null=True, help_text="DD/MM/YY format")
- response_received_date = models.DateField(blank=True, null=True, help_text="DD/MM/YY format")
+ requested_response_date = models.DateField(
+ blank=True, null=True, help_text="DD/MM/YY format"
+ )
+ response_received_date = models.DateField(
+ blank=True, null=True, help_text="DD/MM/YY format"
+ )
class Meta:
abstract = True
-class SingleDateTimeEvent(EventBase, ResponseRequiredMixin, ThirdPartyEventMixin, SingleDateTimeEventMixin):
+class SingleDateTimeEvent(
+ EventBase,
+ ResponseRequiredMixin,
+ URLEventMixin,
+ ThirdPartyEventMixin,
+ SingleDateTimeEventMixin,
+):
AVAILABLE_TYPES = [
(EventType.MEETING.name, "Meeting"),
(EventType.PHONE_CALL.name, "Phone Call"),
(EventType.VIDEO_CALL.name, "Video Call"),
- (EventType.EMAIL.name, "Email")
+ (EventType.EMAIL.name, "Email"),
]
type_descriptor = models.CharField(
blank=False, max_length=50, choices=AVAILABLE_TYPES