Skip to content
Snippets Groups Projects
Commit bbad0e1a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

voucher type structuctures

parent 373bc97a
No related branches found
No related tags found
1 merge request!112Resolve "voucher types"
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-12-08 09:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('web', '0089_unfinshed_appointment_list'),
]
operations = [
migrations.CreateModel(
name='VoucherType',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=20, verbose_name=b'Code')),
('description', models.CharField(blank=True, max_length=1024, verbose_name=b'Description')),
('study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.Study')),
],
),
migrations.CreateModel(
name='VoucherTypePrice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('price', models.DecimalField(decimal_places=2, max_digits=6, verbose_name=b'Price')),
('start_date', models.DateField(verbose_name=b'Start date')),
('end_date', models.DateField(verbose_name=b'End date')),
('voucher_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.VoucherType')),
],
),
]
......@@ -14,6 +14,8 @@ from study_columns import StudyColumns
from visit_columns import VisitColumns
from notification_columns import StudyNotificationParameters
from study import Study
from voucher_type import VoucherType
from voucher_type_price import VoucherTypePrice
from room import Room
from visit import Visit
from worker import Worker
......@@ -36,5 +38,5 @@ from inconsistent_subject import InconsistentSubject, InconsistentField
__all__ = [Study, FlyingTeam, Appointment, AppointmentType, Availability, Holiday, Item, Language, Location, Room,
Subject, StudySubject, StudySubjectList, SubjectColumns, StudyNotificationParameters,
AppointmentList, AppointmentColumns, Visit, Worker, ContactAttempt, ConfigurationItem, MailTemplate,
AppointmentTypeLink,
AppointmentTypeLink, VoucherType, VoucherTypePrice,
MissingSubject, InconsistentSubject, InconsistentField, Country, StudyColumns, VisitColumns, StudyVisitList]
# coding=utf-8
from django.db import models
from web.models import Study
class VoucherType(models.Model):
class Meta:
app_label = 'web'
code = models.CharField(max_length=20, verbose_name='Code', blank=False, null=False)
description = models.CharField(max_length=1024, verbose_name='Description', blank=True, null=False)
study = models.ForeignKey(
Study,
on_delete=models.CASCADE,
null=False,
)
def __str__(self):
return "%s" % self.code
def __unicode__(self):
return "%s" % self.code
# coding=utf-8
from django.db import models
from web.models import VoucherType
class VoucherTypePrice(models.Model):
class Meta:
app_label = 'web'
price = models.DecimalField(max_digits=6, decimal_places=2, verbose_name='Price', null=False, blank=False)
start_date = models.DateField(verbose_name='Start date', null=False, blank=False)
end_date = models.DateField(verbose_name='End date', null=False, blank=False)
voucher_type = models.ForeignKey(
VoucherType,
on_delete=models.CASCADE,
null=False,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment