|
@@ -1,6 +1,7 @@
|
|
|
from datetime import timedelta
|
|
|
import random
|
|
|
from django.db import models
|
|
|
+from django.contrib.auth.models import User
|
|
|
|
|
|
def generate_random_url():
|
|
|
# a-z, A-Z, 0-9, -, _
|
|
@@ -12,6 +13,8 @@ class Event(models.Model):
|
|
|
name = models.CharField(max_length=255)
|
|
|
slot_interval = models.DurationField(default=timedelta(minutes=15))
|
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
+ start_time = models.TimeField(default='09:00')
|
|
|
+ end_time = models.TimeField(default='20:00')
|
|
|
|
|
|
class Date(models.Model):
|
|
|
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
|
@@ -19,6 +22,5 @@ class Date(models.Model):
|
|
|
|
|
|
class Participant(models.Model):
|
|
|
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
|
|
- name = models.CharField(max_length=255)
|
|
|
- pw_hash = models.CharField(max_length=255)
|
|
|
+ user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
slots = models.BinaryField()
|