kers/events/models.py

20 lines
528 B
Python
Raw Normal View History

2020-07-21 22:24:45 +02:00
from django.db import models
2020-07-22 00:51:40 +02:00
from users.models import CustomUser
2020-07-21 22:24:45 +02:00
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)
2020-07-22 00:51:40 +02:00
user_id = models.ForeignKey(CustomUser, on_delete=models.CASCADE)
2020-07-22 01:44:14 +02:00
state = models.CharField(max_length=1, choices=REGISTRATION_STATE)