19 lines
528 B
Python
19 lines
528 B
Python
from django.db import models
|
|
|
|
from users.models import CustomUser
|
|
|
|
|
|
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(CustomUser, on_delete=models.CASCADE)
|
|
state = models.CharField(max_length=1, choices=REGISTRATION_STATE)
|