nmgfitness/nmgfitness/models.py
Jens Timmerman 5afe8d2e4a
All checks were successful
continuous-integration/drone/push Build is passing
fix pylint
2021-08-07 00:09:20 +02:00

21 lines
591 B
Python

"""Nmgfitness Events model"""
from django.db import models
from django.conf import settings
class Events(models.Model):
"""
The events class
The main class used in this project
Events have an id (Autofield primary key)
Start and stop time
and are linked to a user
"""
id = models.AutoField(primary_key=True)
start = models.DateTimeField(null=True, blank=True)
end = models.DateTimeField(null=True, blank=True)
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
def __str__(self):
return self.user.username