You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
530 B

from django.db import models
from django.contrib.auth.models import User
class Event(models.Model):
title = models.CharField(max_length=100)
description = models.TextField()
date = models.DateTimeField()
capacity = models.IntegerField()
created_by = models.ForeignKey(User, on_delete=models.CASCADE)
class Booking(models.Model):
event = models.ForeignKey(Event, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
booked_at = models.DateTimeField(auto_now_add=True)