agendas: add BookingCheck model (#80371)

This commit is contained in:
Valentin Deniaud 2023-08-22 17:46:55 +02:00
parent 17cddfbd4a
commit 6d31c85dd7
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# Generated by Django 3.2.21 on 2023-10-04 13:51
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0160_computed_times'),
]
operations = [
migrations.CreateModel(
name='BookingCheck',
fields=[
(
'id',
models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
('presence', models.BooleanField()),
('start_time', models.TimeField(null=True, verbose_name='Arrival')),
('end_time', models.TimeField(null=True, verbose_name='Departure')),
('type_slug', models.CharField(blank=True, max_length=160, null=True)),
('type_label', models.CharField(blank=True, max_length=150, null=True)),
(
'booking',
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name='user_check',
to='agendas.booking',
),
),
],
),
]

View File

@ -3045,6 +3045,18 @@ class Booking(models.Model):
return True
class BookingCheck(models.Model):
booking = models.OneToOneField(Booking, on_delete=models.CASCADE, related_name='user_check')
presence = models.BooleanField()
start_time = models.TimeField(_('Arrival'), null=True)
end_time = models.TimeField(_('Departure'), null=True)
type_slug = models.CharField(max_length=160, blank=True, null=True)
type_label = models.CharField(max_length=150, blank=True, null=True)
OpeningHour = collections.namedtuple('OpeningHour', ['begin', 'end'])