2020-07-21 22:24:45 +02:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
from users.models import User
|
|
|
|
|
|
|
|
|
|
|
|
class Event(models.Model):
|
|
|
|
date = models.DateTimeField()
|
|
|
|
capacity = models.IntegerField()
|
|
|
|
|
|
|
|
|
|
|
|
class EventRegistration(models.Model):
|
|
|
|
REGISTRATION_STATE = (
|
|
|
|
('I', 'Interested'),
|
|
|
|
('A', 'Admitted'),
|
|
|
|
('D', 'Denied'),
|
|
|
|
)
|
|
|
|
event_id = models.ForeignKey(Event, on_delete=models.CASCADE)
|
|
|
|
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
|
shirt_size = models.CharField(max_length=1, choices=REGISTRATION_STATE)
|