63 lines
2.7 KiB
Python
63 lines
2.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.9.2 on 2016-04-22 20:19
|
|
from __future__ import unicode_literals
|
|
|
|
from django.conf import settings
|
|
import django.contrib.postgres.fields.ranges
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import uuid
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('camps', '0003_auto_20160422_2019'),
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Ticket',
|
|
fields=[
|
|
('created', models.DateTimeField(auto_now_add=True)),
|
|
('updated', models.DateTimeField(auto_now=True)),
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('paid', models.BooleanField(default=False, help_text='Whether the user has paid.', verbose_name='Paid?')),
|
|
('camp', models.ForeignKey(help_text='The camp this ticket is for.', on_delete=django.db.models.deletion.CASCADE, to='camps.Camp', verbose_name='Camp')),
|
|
],
|
|
options={
|
|
'verbose_name_plural': 'Tickets',
|
|
'verbose_name': 'Ticket',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='TicketType',
|
|
fields=[
|
|
('created', models.DateTimeField(auto_now_add=True)),
|
|
('updated', models.DateTimeField(auto_now=True)),
|
|
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('name', models.CharField(max_length=100)),
|
|
('price', models.IntegerField(help_text='Price of the ticket (in DKK).')),
|
|
('available_in', django.contrib.postgres.fields.ranges.DateTimeRangeField(help_text='Which period is this ticket available for purchase?')),
|
|
('camp', models.ForeignKey(help_text='The camp this ticket type is for.', on_delete=django.db.models.deletion.CASCADE, to='camps.Camp', verbose_name='Camp')),
|
|
],
|
|
options={
|
|
'verbose_name_plural': 'Ticket Types',
|
|
'verbose_name': 'Ticket Type',
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='ticket',
|
|
name='ticket_type',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tickets.TicketType'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='ticket',
|
|
name='user',
|
|
field=models.ForeignKey(help_text='The user this ticket belongs to.', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User'),
|
|
),
|
|
]
|