diff --git a/src/pretix/base/migrations/0023_auto_20160601_1039.py b/src/pretix/base/migrations/0023_auto_20160601_1039.py new file mode 100644 index 000000000..3aec83343 --- /dev/null +++ b/src/pretix/base/migrations/0023_auto_20160601_1039.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-01 10:39 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0022_merge'), + ] + + operations = [ + migrations.AddField( + model_name='voucher', + name='comment', + field=models.TextField(blank=True, help_text='The text entered in this field will not be visible to the user and is available for your convenience.', verbose_name='Comment'), + ), + migrations.AddField( + model_name='voucher', + name='tag', + field=models.CharField(blank=True, help_text='You can use this field to group multiple vouchers together. If you enter the same value for multiple vouchers, you can get statistics on how many of them have been redeemed etc.', max_length=255, verbose_name='Tag'), + ), + ] diff --git a/src/pretix/base/models/vouchers.py b/src/pretix/base/models/vouchers.py index 4688792bb..5da2a6fa4 100644 --- a/src/pretix/base/models/vouchers.py +++ b/src/pretix/base/models/vouchers.py @@ -101,6 +101,18 @@ class Voucher(LoggedModel): "If enabled, the voucher is valid for any product affected by this quota." ) ) + tag = models.CharField( + max_length=255, + verbose_name=_("Tag"), + blank=True, + help_text=_("You can use this field to group multiple vouchers together. If you enter the same value for " + "multiple vouchers, you can get statistics on how many of them have been redeemed etc.") + ) + comment = models.TextField( + blank=True, verbose_name=_("Comment"), + help_text=_("The text entered in this field will not be visible to the user and is available for your " + "convenience.") + ) class Meta: verbose_name = _("Voucher") diff --git a/src/pretix/control/forms/vouchers.py b/src/pretix/control/forms/vouchers.py index a81d52a4e..4fbccea21 100644 --- a/src/pretix/control/forms/vouchers.py +++ b/src/pretix/control/forms/vouchers.py @@ -18,7 +18,8 @@ class VoucherForm(I18nModelForm): model = Voucher localized_fields = '__all__' fields = [ - 'code', 'valid_until', 'block_quota', 'allow_ignore_quota', 'price' + 'code', 'valid_until', 'block_quota', 'allow_ignore_quota', 'price', 'tag', + 'comment' ] def __init__(self, *args, **kwargs): diff --git a/src/pretix/control/templates/pretixcontrol/vouchers/detail.html b/src/pretix/control/templates/pretixcontrol/vouchers/detail.html index cc620b55f..f3ebf569c 100644 --- a/src/pretix/control/templates/pretixcontrol/vouchers/detail.html +++ b/src/pretix/control/templates/pretixcontrol/vouchers/detail.html @@ -20,13 +20,21 @@ {% bootstrap_field form.allow_ignore_quota layout="horizontal" %} {% bootstrap_field form.price layout="horizontal" %} {% bootstrap_field form.itemvar layout="horizontal" %} -