diff --git a/registrasion/admin.py b/registrasion/admin.py index 4d704c9b..95e46b70 100644 --- a/registrasion/admin.py +++ b/registrasion/admin.py @@ -97,6 +97,19 @@ class SpeakerDiscountAdmin(admin.ModelAdmin, EffectsDisplayMixin): ] +@admin.register(conditions.GroupMemberDiscount) +class GroupMemberDiscountAdmin(admin.ModelAdmin, EffectsDisplayMixin): + + fields = ("description", "group") + + list_display = ("description", "effects") + + inlines = [ + DiscountForProductInline, + DiscountForCategoryInline, + ] + + # Vouchers class VoucherDiscountInline(nested_admin.NestedStackedInline): @@ -194,3 +207,11 @@ class SpeakerFlagAdmin(nested_admin.NestedAdmin, EffectsDisplayMixin): list_display = ("description", "is_presenter", "is_copresenter", "effects") ordering = ("-is_presenter", "-is_copresenter") + + +@admin.register(conditions.GroupMemberFlag) +class GroupMemberFlagAdmin(admin.ModelAdmin, EffectsDisplayMixin): + + fields = ("description", "group") + + list_display = ("description", "effects") diff --git a/registrasion/migrations/0004_groupmemberdiscount_groupmemberflag.py b/registrasion/migrations/0004_groupmemberdiscount_groupmemberflag.py new file mode 100644 index 00000000..0b980e57 --- /dev/null +++ b/registrasion/migrations/0004_groupmemberdiscount_groupmemberflag.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-09-04 23:59 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('auth', '0007_alter_validators_add_error_messages'), + ('registrasion', '0003_auto_20160904_0235'), + ] + + operations = [ + migrations.CreateModel( + name='GroupMemberDiscount', + fields=[ + ('discountbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.DiscountBase')), + ('group', models.ManyToManyField(help_text='The groups a user needs to be a member of for thiscondition to be met.', to='auth.Group')), + ], + options={ + 'verbose_name': 'discount (group member)', + 'verbose_name_plural': 'discounts (group member)', + }, + bases=('registrasion.discountbase', models.Model), + ), + migrations.CreateModel( + name='GroupMemberFlag', + fields=[ + ('flagbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.FlagBase')), + ('group', models.ManyToManyField(help_text='The groups a user needs to be a member of for thiscondition to be met.', to='auth.Group')), + ], + options={ + 'verbose_name': 'flag (group member)', + 'verbose_name_plural': 'flags (group member)', + }, + bases=('registrasion.flagbase', models.Model), + ), + ]