-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
292 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from decimal import Decimal | ||
|
||
import versions.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('pretixbase', '0004_auto_20151024_0848'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Voucher', | ||
fields=[ | ||
('id', models.CharField(serialize=False, primary_key=True, max_length=36)), | ||
('identity', models.CharField(max_length=36)), | ||
('version_start_date', models.DateTimeField()), | ||
('version_end_date', models.DateTimeField(null=True, blank=True, default=None)), | ||
('version_birth_date', models.DateTimeField()), | ||
('code', models.CharField(verbose_name='Voucher code', max_length=255)), | ||
('max_usages', models.PositiveIntegerField(null=True, blank=True, verbose_name='How often can this voucher code be used?', help_text='One product sold counts as one usage. Leave empty for unlimited usages.')), | ||
('valid_until', models.DateTimeField(null=True, blank=True, verbose_name='Valid until')), | ||
('block_quota', models.BooleanField(default=False, verbose_name='Reserve tickets from quota', help_text="If activated, the maximum number of usages of this voucher will be substracted from the affected product's quotas, such that it is guaranteed that anyone with this voucher code does receive a ticket.")), | ||
('benefit', models.CharField(choices=[('product_fix_off', 'Fixed discount'), ('product_percent_off', 'Percent discount'), ('product_fix', 'Fixed price for product')], verbose_name='Type of voucher', max_length=255)), | ||
('value', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)), | ||
('event', versions.models.VersionedForeignKey(related_name='vouchers', verbose_name='Event', to='pretixbase.Event')), | ||
('items', versions.models.VersionedManyToManyField(related_name='vouchers', verbose_name='Applicable to products', to='pretixbase.Item')), | ||
], | ||
options={ | ||
'verbose_name': 'Voucher', | ||
'verbose_name_plural': 'Vouchers', | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='cartposition', | ||
name='base_price', | ||
field=models.DecimalField(null=True, blank=True, decimal_places=2, max_digits=10), | ||
), | ||
migrations.AddField( | ||
model_name='cartposition', | ||
name='voucher_discount', | ||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10), | ||
), | ||
migrations.AddField( | ||
model_name='orderposition', | ||
name='base_price', | ||
field=models.DecimalField(null=True, blank=True, decimal_places=2, max_digits=10), | ||
), | ||
migrations.AddField( | ||
model_name='orderposition', | ||
name='voucher_discount', | ||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10), | ||
), | ||
migrations.AlterField( | ||
model_name='orderposition', | ||
name='item', | ||
field=versions.models.VersionedForeignKey(to='pretixbase.Item', verbose_name='Item'), | ||
), | ||
migrations.AddField( | ||
model_name='cartposition', | ||
name='voucher', | ||
field=models.ForeignKey(null=True, blank=True, to='pretixbase.Voucher'), | ||
), | ||
migrations.AddField( | ||
model_name='orderposition', | ||
name='voucher', | ||
field=models.ForeignKey(null=True, blank=True, to='pretixbase.Voucher'), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='voucher', | ||
unique_together=set([('event', 'code')]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.