nmgfitness/nmgfitness/models.py

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