Browse Source

Actualizar 'reservas/models.py'

master
creylopez 1 year ago
parent
commit
4aee526398
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      reservas/models.py

+ 12
- 1
reservas/models.py View File

@ -1,3 +1,14 @@
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
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)

Loading…
Cancel
Save