aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-21 17:08:24 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-21 17:08:35 +0100
commitecd2c19b265e3974707da0d9b8e260749dcf4a9f (patch)
treea47b8e820e98e39fca7108c1f98bc500bf0c98d9 /ctrack/register/models.py
parent07c741c785761cfa0e9895e35ba7e1f1549ce676 (diff)
renamed a field in a model to date and look what I need! new migrations and fixed tests
Diffstat (limited to 'ctrack/register/models.py')
-rw-r--r--ctrack/register/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ctrack/register/models.py b/ctrack/register/models.py
index 1ce905a..34dc880 100644
--- a/ctrack/register/models.py
+++ b/ctrack/register/models.py
@@ -117,7 +117,7 @@ class URLEventMixin(models.Model):
class SingleDateTimeEventMixin(models.Model):
- datetime = models.DateTimeField(
+ date = models.DateTimeField(
blank=False, verbose_name="Date/Time", help_text="DD/MM/YY HH:MM format please!"
)
@@ -133,7 +133,7 @@ class SingleDateMixin(models.Model):
class TwinDateMixin(models.Model):
- start_date = models.DateField(blank=False, null=False)
+ date = models.DateField(blank=False, null=False)
end_date = models.DateField(blank=True, null=True)
class Meta:
@@ -249,13 +249,13 @@ class CAFTwinDateEvent(EventBase, CAFMixin, TwinDateMixin):
return "".join(["CAFTwinDateEvent(", self.type_descriptor, ")"])
def __str__(self):
- return f"CAFTwinDateEvent({self.type_descriptor}) starting {self.start_date}"
+ return f"CAFTwinDateEvent({self.type_descriptor}) starting {self.date}"
class Meta:
constraints = [
models.CheckConstraint(
name="%(app_label)s_%(class)s_cannot_precede_start_date",
- check=~models.Q(end_date__lt=F("start_date")),
+ check=~models.Q(end_date__lt=F("date")),
)
]