diff --git a/docs/integration.rst b/docs/integration.rst index bdf7845b..aebfa2f8 100644 --- a/docs/integration.rst +++ b/docs/integration.rst @@ -1,11 +1,35 @@ -Integrating Registrasion -======================== +Installing and integrating Registrasion +======================================= -Registrasion is a Django app. It does not provide any templates -- you'll need to develop these yourself. You can use the ``registrasion-demo`` project as a starting point. +Registrasion is a Django app. It does not provide any templates -- you'll need to develop these yourself. You can use the `registrasion-demo `_ project as a starting point. -To use Registrasion for your own conference, you'll need to do a small amount of development work, usually in your own Django App. +To use Registrasion for your own conference, you'll need to do a small amount of configuration and development work, in your own Django App. -The first is to define a model and form for your attendee profile, and the second is to implement a payment app. +The configuration that you'll need to do is minimal. The first piece of development work is to define a model and form for your attendee profile, and the second is to implement a payment app. + + +Installing Registrasion +----------------------- + +Registrasion depends on an in-development version of Symposion. You'll need to add the following two lines to your ``requirements.txt`` files:: + + git+https://github.com/pinax/symposion.git@ad81810 + git+https://github.com/chrisjrn/registrasion.git@releases/0.1 + +Symposion currently specifies Django version 1.9.2. + +Running ``pip install -r requirements.txt`` will pull down the git version of Symposion as well as the current 0.1 release of Registrasion. + + +Configuring your Django App +--------------------------- + +In your Django ``settings.py`` file, you'll need to add the following to your ``INSTALLED_APPS``:: + + "registrasion", + "nested_admin", + +You will also need to configure ``symposion`` appropriately. Attendee profile diff --git a/docs/inventory.rst b/docs/inventory.rst index 65ac9c46..c9d6dec1 100644 --- a/docs/inventory.rst +++ b/docs/inventory.rst @@ -4,6 +4,11 @@ Inventory Management Registrasion uses an inventory model to keep track of tickets, and the other various products that attendees of your conference might want to have, such as t-shirts and dinner tickets. +All of the classes described herein are available through the Django Admin interface. + +Overview +-------- + The inventory model is split up into Categories and Products. Categories are used to group Products. Registrasion uses conditionals to build up complex tickets, or enable/disable specific items to specific users: diff --git a/docs/views.rst b/docs/views.rst index ea30f748..313337ec 100644 --- a/docs/views.rst +++ b/docs/views.rst @@ -1,11 +1,22 @@ -Public-facing views -=================== +User-facing views +================= + + +View functions +-------------- Here's all of the views that Registrasion exposes to the public. .. automodule:: registrasion.views :members: +Data types +~~~~~~~~~~ + +.. automodule:: registrasion.controllers.discount + +.. autoclass:: DiscountAndQuantity + Template tags ------------- @@ -14,3 +25,17 @@ Registrasion makes template tags available: .. automodule:: registrasion.templatetags.registrasion_tags :members: + + +Rendering invoices +------------------ + +You'll need to render the following Django models in order to view invoices. + +.. automodule:: registrasion.models.commerce + +.. autoclass:: Invoice + +.. autoclass:: LineItem + +See also: :class:`PaymentBase` diff --git a/registrasion/controllers/cart.py b/registrasion/controllers/cart.py index f8cbd0f5..20bd6b5c 100644 --- a/registrasion/controllers/cart.py +++ b/registrasion/controllers/cart.py @@ -266,7 +266,6 @@ class CartController(object): ) for item in items: - print item required.remove(item.product.category) errors = [] @@ -279,7 +278,6 @@ class CartController(object): def _append_errors(self, errors, ve): for error in ve.error_list: - print error.message errors.append(error.message[1]) def validate_cart(self): diff --git a/registrasion/controllers/discount.py b/registrasion/controllers/discount.py index e73928d0..a8f9282e 100644 --- a/registrasion/controllers/discount.py +++ b/registrasion/controllers/discount.py @@ -8,6 +8,25 @@ from django.db.models import Sum class DiscountAndQuantity(object): + ''' Represents a discount that can be applied to a product or category + for a given user. + + Attributes: + + discount (conditions.DiscountBase): The discount object that the + clause arises from. A given DiscountBase can apply to multiple + clauses. + + clause (conditions.DiscountForProduct|conditions.DiscountForCategory): + A clause describing which product or category this discount item + applies to. This casts to ``str()`` to produce a human-readable + version of the clause. + + quantity (int): The number of times this discount item can be applied + for the given user. + + ''' + def __init__(self, discount, clause, quantity): self.discount = discount self.clause = clause diff --git a/registrasion/migrations/0001_initial.py b/registrasion/migrations/0001_initial.py new file mode 100644 index 00000000..aa9cebd3 --- /dev/null +++ b/registrasion/migrations/0001_initial.py @@ -0,0 +1,383 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.2 on 2016-04-25 08:30 +from __future__ import unicode_literals + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import registrasion.models.commerce + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Attendee', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('access_code', models.CharField(db_index=True, max_length=6, unique=True)), + ('completed_registration', models.BooleanField(default=False)), + ], + ), + migrations.CreateModel( + name='AttendeeProfileBase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('attendee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Attendee')), + ], + ), + migrations.CreateModel( + name='Cart', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time_last_updated', models.DateTimeField(db_index=True)), + ('reservation_duration', models.DurationField()), + ('revision', models.PositiveIntegerField(default=1)), + ('status', models.IntegerField(choices=[(1, 'Active'), (2, 'Paid'), (3, 'Released')], db_index=True, default=1)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=65, verbose_name='Name')), + ('description', models.CharField(max_length=255, verbose_name='Description')), + ('limit_per_user', models.PositiveIntegerField(blank=True, help_text='The total number of items from this category one attendee may purchase.', null=True, verbose_name='Limit per user')), + ('required', models.BooleanField(help_text='If enabled, a user must select an item from this category.')), + ('order', models.PositiveIntegerField(db_index=True, verbose_name=b'Display order')), + ('render_type', models.IntegerField(choices=[(1, 'Radio button'), (2, 'Quantity boxes')], help_text='The registration form will render this category in this style.', verbose_name='Render type')), + ], + options={ + 'ordering': ('order',), + 'verbose_name': 'inventory - category', + 'verbose_name_plural': 'inventory - categories', + }, + ), + migrations.CreateModel( + name='CreditNoteRefund', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time', models.DateTimeField(default=django.utils.timezone.now)), + ('reference', models.CharField(max_length=255)), + ], + bases=(registrasion.models.commerce.CleanOnSave, models.Model), + ), + migrations.CreateModel( + name='DiscountBase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.CharField(help_text='A description of this discount. This will be included on invoices where this discount is applied.', max_length=255, verbose_name='Description')), + ], + ), + migrations.CreateModel( + name='DiscountForCategory', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('percentage', models.DecimalField(decimal_places=1, max_digits=4)), + ('quantity', models.PositiveIntegerField()), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Category')), + ], + ), + migrations.CreateModel( + name='DiscountForProduct', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('percentage', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)), + ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True)), + ('quantity', models.PositiveIntegerField()), + ], + ), + migrations.CreateModel( + name='DiscountItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveIntegerField()), + ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Cart')), + ], + options={ + 'ordering': ('product',), + }, + ), + migrations.CreateModel( + name='FlagBase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.CharField(max_length=255)), + ('condition', models.IntegerField(choices=[(1, 'Disable if false'), (2, 'Enable if true')], default=2, help_text="If there is at least one 'disable if false' flag defined on a product or category, all such flag conditions must be met. If there is at least one 'enable if true' flag, at least one such condition must be met. If both types of conditions exist on a product, both of these rules apply.")), + ], + ), + migrations.CreateModel( + name='Invoice', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cart_revision', models.IntegerField(db_index=True, null=True)), + ('status', models.IntegerField(choices=[(1, 'Unpaid'), (2, 'Paid'), (3, 'Refunded'), (4, 'VOID')], db_index=True)), + ('recipient', models.CharField(max_length=1024)), + ('issue_time', models.DateTimeField()), + ('due_time', models.DateTimeField()), + ('value', models.DecimalField(decimal_places=2, max_digits=8)), + ('cart', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='registrasion.Cart')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='LineItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.CharField(max_length=255)), + ('quantity', models.PositiveIntegerField()), + ('price', models.DecimalField(decimal_places=2, max_digits=8)), + ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Invoice')), + ], + options={ + 'ordering': ('id',), + }, + ), + migrations.CreateModel( + name='PaymentBase', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time', models.DateTimeField(default=django.utils.timezone.now)), + ('reference', models.CharField(max_length=255)), + ('amount', models.DecimalField(decimal_places=2, max_digits=8)), + ], + options={ + 'ordering': ('time',), + }, + ), + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=65, verbose_name='Name')), + ('description', models.CharField(blank=True, max_length=255, null=True, verbose_name='Description')), + ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Price')), + ('limit_per_user', models.PositiveIntegerField(blank=True, null=True, verbose_name='Limit per user')), + ('reservation_duration', models.DurationField(default=datetime.timedelta(0, 3600), help_text='The length of time this product will be reserved before it is released for someone else to purchase.', verbose_name='Reservation duration')), + ('order', models.PositiveIntegerField(db_index=True, verbose_name=b'Display order')), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Category', verbose_name='Product category')), + ], + options={ + 'ordering': ('category__order', 'order'), + 'verbose_name': 'inventory - product', + }, + ), + migrations.CreateModel( + name='ProductItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('quantity', models.PositiveIntegerField(db_index=True)), + ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Cart')), + ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Product')), + ], + options={ + 'ordering': ('product',), + }, + ), + migrations.CreateModel( + name='Voucher', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('recipient', models.CharField(max_length=64, verbose_name='Recipient')), + ('code', models.CharField(max_length=16, unique=True, verbose_name='Voucher code')), + ('limit', models.PositiveIntegerField(verbose_name='Voucher use limit')), + ], + ), + migrations.CreateModel( + name='CategoryFlag', + 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')), + ('enabling_category', models.ForeignKey(help_text='If a product from this category is purchased, this condition is met.', on_delete=django.db.models.deletion.CASCADE, to='registrasion.Category')), + ], + options={ + 'verbose_name': 'flag (dependency on product from category)', + 'verbose_name_plural': 'flags (dependency on product from category)', + }, + bases=('registrasion.flagbase',), + ), + migrations.CreateModel( + name='CreditNote', + fields=[ + ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), + ], + bases=('registrasion.paymentbase',), + ), + migrations.CreateModel( + name='CreditNoteApplication', + fields=[ + ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), + ('parent', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.CreditNote')), + ], + bases=(registrasion.models.commerce.CleanOnSave, 'registrasion.paymentbase'), + ), + migrations.CreateModel( + name='IncludedProductDiscount', + 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')), + ('enabling_products', models.ManyToManyField(help_text='If one of these products are purchased, the discounts below will be enabled.', to='registrasion.Product', verbose_name='Including product')), + ], + options={ + 'verbose_name': 'discount (product inclusions)', + 'verbose_name_plural': 'discounts (product inclusions)', + }, + bases=('registrasion.discountbase',), + ), + migrations.CreateModel( + name='ManualCreditNoteRefund', + fields=[ + ('creditnoterefund_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.CreditNoteRefund')), + ('entered_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + bases=('registrasion.creditnoterefund',), + ), + migrations.CreateModel( + name='ManualPayment', + fields=[ + ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), + ('entered_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + bases=('registrasion.paymentbase',), + ), + migrations.CreateModel( + name='ProductFlag', + 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')), + ('enabling_products', models.ManyToManyField(help_text='If one of these products are purchased, this condition is met.', to='registrasion.Product')), + ], + options={ + 'verbose_name': 'flag (dependency on product)', + 'verbose_name_plural': 'flags (dependency on product)', + }, + bases=('registrasion.flagbase',), + ), + migrations.CreateModel( + name='TimeOrStockLimitDiscount', + 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')), + ('start_time', models.DateTimeField(blank=True, help_text='This discount will only be available after this time.', null=True, verbose_name='Start time')), + ('end_time', models.DateTimeField(blank=True, help_text='This discount will only be available before this time.', null=True, verbose_name='End time')), + ('limit', models.PositiveIntegerField(blank=True, help_text='This discount may only be applied this many times.', null=True, verbose_name='Limit')), + ], + options={ + 'verbose_name': 'discount (time/stock limit)', + 'verbose_name_plural': 'discounts (time/stock limit)', + }, + bases=('registrasion.discountbase',), + ), + migrations.CreateModel( + name='TimeOrStockLimitFlag', + 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')), + ('start_time', models.DateTimeField(blank=True, help_text='Products included in this condition will only be available after this time.', null=True)), + ('end_time', models.DateTimeField(blank=True, help_text='Products included in this condition will only be available before this time.', null=True)), + ('limit', models.PositiveIntegerField(blank=True, help_text='The number of items under this grouping that can be purchased.', null=True)), + ], + options={ + 'verbose_name': 'flag (time/stock limit)', + 'verbose_name_plural': 'flags (time/stock limit)', + }, + bases=('registrasion.flagbase',), + ), + migrations.CreateModel( + name='VoucherDiscount', + 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')), + ('voucher', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Voucher', verbose_name='Voucher')), + ], + options={ + 'verbose_name': 'discount (enabled by voucher)', + 'verbose_name_plural': 'discounts (enabled by voucher)', + }, + bases=('registrasion.discountbase',), + ), + migrations.CreateModel( + name='VoucherFlag', + 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')), + ('voucher', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Voucher')), + ], + options={ + 'verbose_name': 'flag (dependency on voucher)', + 'verbose_name_plural': 'flags (dependency on voucher)', + }, + bases=('registrasion.flagbase',), + ), + migrations.AddField( + model_name='paymentbase', + name='invoice', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Invoice'), + ), + migrations.AddField( + model_name='lineitem', + name='product', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registrasion.Product'), + ), + migrations.AddField( + model_name='flagbase', + name='categories', + field=models.ManyToManyField(blank=True, help_text="Categories whose products are affected by this flag's condition.", related_name='flagbase_set', to='registrasion.Category'), + ), + migrations.AddField( + model_name='flagbase', + name='products', + field=models.ManyToManyField(blank=True, help_text="Products affected by this flag's condition.", related_name='flagbase_set', to='registrasion.Product'), + ), + migrations.AddField( + model_name='discountitem', + name='discount', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.DiscountBase'), + ), + migrations.AddField( + model_name='discountitem', + name='product', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Product'), + ), + migrations.AddField( + model_name='discountforproduct', + name='discount', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.DiscountBase'), + ), + migrations.AddField( + model_name='discountforproduct', + name='product', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Product'), + ), + migrations.AddField( + model_name='discountforcategory', + name='discount', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.DiscountBase'), + ), + migrations.AddField( + model_name='cart', + name='vouchers', + field=models.ManyToManyField(blank=True, to='registrasion.Voucher'), + ), + migrations.AddField( + model_name='attendee', + name='guided_categories_complete', + field=models.ManyToManyField(to='registrasion.Category'), + ), + migrations.AddField( + model_name='attendee', + name='user', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='creditnoterefund', + name='parent', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.CreditNote'), + ), + migrations.AlterIndexTogether( + name='cart', + index_together=set([('status', 'user'), ('status', 'time_last_updated')]), + ), + ] diff --git a/registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py b/registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py deleted file mode 100644 index cc1e3f0d..00000000 --- a/registrasion/migrations/0001_squashed_0002_auto_20160304_1723.py +++ /dev/null @@ -1,287 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import datetime -import django.utils.timezone -from django.conf import settings - - -class Migration(migrations.Migration): - - replaces = [('registrasion', '0001_initial'), ('registrasion', '0002_auto_20160304_1723')] - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name='Badge', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=256)), - ('company', models.CharField(max_length=256)), - ], - ), - migrations.CreateModel( - name='Cart', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('time_last_updated', models.DateTimeField()), - ('reservation_duration', models.DurationField()), - ('revision', models.PositiveIntegerField(default=1)), - ('active', models.BooleanField(default=True)), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Category', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=65, verbose_name='Name')), - ('description', models.CharField(max_length=255, verbose_name='Description')), - ('order', models.PositiveIntegerField(verbose_name='Display order')), - ('render_type', models.IntegerField(verbose_name='Render type', choices=[(1, 'Radio button'), (2, 'Quantity boxes')])), - ], - ), - migrations.CreateModel( - name='DiscountBase', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('description', models.CharField(max_length=255, verbose_name='Description')), - ], - ), - migrations.CreateModel( - name='DiscountForCategory', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('percentage', models.DecimalField(max_digits=4, decimal_places=1, blank=True)), - ('quantity', models.PositiveIntegerField()), - ('category', models.ForeignKey(to='registrasion.Category')), - ], - ), - migrations.CreateModel( - name='DiscountForProduct', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('percentage', models.DecimalField(null=True, max_digits=4, decimal_places=1)), - ('price', models.DecimalField(null=True, max_digits=8, decimal_places=2)), - ('quantity', models.PositiveIntegerField()), - ], - ), - migrations.CreateModel( - name='DiscountItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('quantity', models.PositiveIntegerField()), - ('cart', models.ForeignKey(to='registrasion.Cart')), - ], - ), - migrations.CreateModel( - name='EnablingConditionBase', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('description', models.CharField(max_length=255)), - ('mandatory', models.BooleanField(default=False)), - ], - ), - migrations.CreateModel( - name='Invoice', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('cart_revision', models.IntegerField(null=True)), - ('void', models.BooleanField(default=False)), - ('paid', models.BooleanField(default=False)), - ('value', models.DecimalField(max_digits=8, decimal_places=2)), - ('cart', models.ForeignKey(to='registrasion.Cart', null=True)), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='LineItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('description', models.CharField(max_length=255)), - ('quantity', models.PositiveIntegerField()), - ('price', models.DecimalField(max_digits=8, decimal_places=2)), - ('invoice', models.ForeignKey(to='registrasion.Invoice')), - ], - ), - migrations.CreateModel( - name='Payment', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('time', models.DateTimeField(default=django.utils.timezone.now)), - ('reference', models.CharField(max_length=64)), - ('amount', models.DecimalField(max_digits=8, decimal_places=2)), - ('invoice', models.ForeignKey(to='registrasion.Invoice')), - ], - ), - migrations.CreateModel( - name='Product', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(max_length=65, verbose_name='Name')), - ('description', models.CharField(max_length=255, verbose_name='Description')), - ('price', models.DecimalField(verbose_name='Price', max_digits=8, decimal_places=2)), - ('limit_per_user', models.PositiveIntegerField(verbose_name='Limit per user', blank=True)), - ('reservation_duration', models.DurationField(default=datetime.timedelta(0, 3600), verbose_name='Reservation duration')), - ('order', models.PositiveIntegerField(verbose_name='Display order')), - ('category', models.ForeignKey(verbose_name='Product category', to='registrasion.Category')), - ], - ), - migrations.CreateModel( - name='ProductItem', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('quantity', models.PositiveIntegerField()), - ('cart', models.ForeignKey(to='registrasion.Cart')), - ('product', models.ForeignKey(to='registrasion.Product')), - ], - ), - migrations.CreateModel( - name='Profile', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('completed_registration', models.BooleanField(default=False)), - ('highest_complete_category', models.IntegerField(default=0)), - ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='Voucher', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('recipient', models.CharField(max_length=64, verbose_name='Recipient')), - ('code', models.CharField(unique=True, max_length=16, verbose_name='Voucher code')), - ('limit', models.PositiveIntegerField(verbose_name='Voucher use limit')), - ], - ), - migrations.CreateModel( - name='CategoryEnablingCondition', - fields=[ - ('enablingconditionbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.EnablingConditionBase')), - ('enabling_category', models.ForeignKey(to='registrasion.Category')), - ], - bases=('registrasion.enablingconditionbase',), - ), - migrations.CreateModel( - name='IncludedProductDiscount', - fields=[ - ('discountbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.DiscountBase')), - ('enabling_products', models.ManyToManyField(to=b'registrasion.Product', verbose_name='Including product')), - ], - options={ - 'verbose_name': 'Product inclusion', - }, - bases=('registrasion.discountbase',), - ), - migrations.CreateModel( - name='ProductEnablingCondition', - fields=[ - ('enablingconditionbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.EnablingConditionBase')), - ('enabling_products', models.ManyToManyField(to=b'registrasion.Product')), - ], - bases=('registrasion.enablingconditionbase',), - ), - migrations.CreateModel( - name='TimeOrStockLimitDiscount', - fields=[ - ('discountbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.DiscountBase')), - ('start_time', models.DateTimeField(null=True, verbose_name='Start time', blank=True)), - ('end_time', models.DateTimeField(null=True, verbose_name='End time', blank=True)), - ('limit', models.PositiveIntegerField(null=True, verbose_name='Limit', blank=True)), - ], - options={ - 'verbose_name': 'Promotional discount', - }, - bases=('registrasion.discountbase',), - ), - migrations.CreateModel( - name='TimeOrStockLimitEnablingCondition', - fields=[ - ('enablingconditionbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.EnablingConditionBase')), - ('start_time', models.DateTimeField(null=True, verbose_name='Start time')), - ('end_time', models.DateTimeField(null=True, verbose_name='End time')), - ('limit', models.PositiveIntegerField(null=True, verbose_name='Limit')), - ], - bases=('registrasion.enablingconditionbase',), - ), - migrations.CreateModel( - name='VoucherDiscount', - fields=[ - ('discountbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.DiscountBase')), - ('voucher', models.OneToOneField(verbose_name='Voucher', to='registrasion.Voucher')), - ], - bases=('registrasion.discountbase',), - ), - migrations.CreateModel( - name='VoucherEnablingCondition', - fields=[ - ('enablingconditionbase_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='registrasion.EnablingConditionBase')), - ('voucher', models.OneToOneField(to='registrasion.Voucher')), - ], - bases=('registrasion.enablingconditionbase',), - ), - migrations.AddField( - model_name='enablingconditionbase', - name='categories', - field=models.ManyToManyField(to=b'registrasion.Category', blank=True), - ), - migrations.AddField( - model_name='enablingconditionbase', - name='products', - field=models.ManyToManyField(to=b'registrasion.Product', blank=True), - ), - migrations.AddField( - model_name='discountitem', - name='discount', - field=models.ForeignKey(to='registrasion.DiscountBase'), - ), - migrations.AddField( - model_name='discountitem', - name='product', - field=models.ForeignKey(to='registrasion.Product'), - ), - migrations.AddField( - model_name='discountforproduct', - name='discount', - field=models.ForeignKey(to='registrasion.DiscountBase'), - ), - migrations.AddField( - model_name='discountforproduct', - name='product', - field=models.ForeignKey(to='registrasion.Product'), - ), - migrations.AddField( - model_name='discountforcategory', - name='discount', - field=models.ForeignKey(to='registrasion.DiscountBase'), - ), - migrations.AddField( - model_name='cart', - name='vouchers', - field=models.ManyToManyField(to=b'registrasion.Voucher', blank=True), - ), - migrations.AddField( - model_name='badge', - name='profile', - field=models.OneToOneField(to='registrasion.Profile'), - ), - migrations.AlterField( - model_name='discountforcategory', - name='percentage', - field=models.DecimalField(max_digits=4, decimal_places=1), - ), - migrations.AlterField( - model_name='discountforproduct', - name='percentage', - field=models.DecimalField(null=True, max_digits=4, decimal_places=1, blank=True), - ), - migrations.AlterField( - model_name='discountforproduct', - name='price', - field=models.DecimalField(null=True, max_digits=8, decimal_places=2, blank=True), - ), - ] diff --git a/registrasion/migrations/0002_auto_20160323_2029.py b/registrasion/migrations/0002_auto_20160323_2029.py deleted file mode 100644 index 491c6865..00000000 --- a/registrasion/migrations/0002_auto_20160323_2029.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0001_squashed_0002_auto_20160304_1723'), - ] - - operations = [ - migrations.AddField( - model_name='badge', - name='accessibility_requirements', - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name='badge', - name='dietary_requirements', - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name='badge', - name='free_text_1', - field=models.CharField(help_text="A line of free text that will appear on your badge. Use this for your Twitter handle, IRC nick, your preferred pronouns or anything else you'd like people to see on your badge.", max_length=64, verbose_name='Free text line 1', blank=True), - ), - migrations.AddField( - model_name='badge', - name='free_text_2', - field=models.CharField(max_length=64, verbose_name='Free text line 2', blank=True), - ), - migrations.AddField( - model_name='badge', - name='gender', - field=models.CharField(max_length=64, blank=True), - ), - migrations.AddField( - model_name='badge', - name='of_legal_age', - field=models.BooleanField(default=False, verbose_name='18+?'), - ), - migrations.AlterField( - model_name='badge', - name='company', - field=models.CharField(help_text="The name of your company, as you'd like it on your badge", max_length=64, blank=True), - ), - migrations.AlterField( - model_name='badge', - name='name', - field=models.CharField(help_text="Your name, as you'd like it on your badge", max_length=64), - ), - ] diff --git a/registrasion/migrations/0003_auto_20160323_2044.py b/registrasion/migrations/0003_auto_20160323_2044.py deleted file mode 100644 index 931dc77f..00000000 --- a/registrasion/migrations/0003_auto_20160323_2044.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0002_auto_20160323_2029'), - ] - - operations = [ - migrations.AddField( - model_name='badge', - name='name_per_invoice', - field=models.CharField(help_text="If your legal name is different to the name on your badge, fill this in, and we'll put it on your invoice. Otherwise, leave it blank.", max_length=64, verbose_name='Your legal name (for invoicing purposes)', blank=True), - ), - migrations.AlterField( - model_name='badge', - name='name', - field=models.CharField(help_text="Your name, as you'd like it to appear on your badge. ", max_length=64, verbose_name='Your name (for your conference nametag)'), - ), - ] diff --git a/registrasion/migrations/0004_auto_20160323_2137.py b/registrasion/migrations/0004_auto_20160323_2137.py deleted file mode 100644 index e6514b59..00000000 --- a/registrasion/migrations/0004_auto_20160323_2137.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registrasion', '0003_auto_20160323_2044'), - ] - - operations = [ - migrations.CreateModel( - name='Attendee', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('completed_registration', models.BooleanField(default=False)), - ('highest_complete_category', models.IntegerField(default=0)), - ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)), - ], - ), - migrations.CreateModel( - name='BadgeAndProfile', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('name', models.CharField(help_text="Your name, as you'd like it to appear on your badge. ", max_length=64, verbose_name='Your name (for your conference nametag)')), - ('company', models.CharField(help_text="The name of your company, as you'd like it on your badge", max_length=64, blank=True)), - ('free_text_1', models.CharField(help_text="A line of free text that will appear on your badge. Use this for your Twitter handle, IRC nick, your preferred pronouns or anything else you'd like people to see on your badge.", max_length=64, verbose_name='Free text line 1', blank=True)), - ('free_text_2', models.CharField(max_length=64, verbose_name='Free text line 2', blank=True)), - ('name_per_invoice', models.CharField(help_text="If your legal name is different to the name on your badge, fill this in, and we'll put it on your invoice. Otherwise, leave it blank.", max_length=64, verbose_name='Your legal name (for invoicing purposes)', blank=True)), - ('of_legal_age', models.BooleanField(default=False, verbose_name='18+?')), - ('dietary_requirements', models.CharField(max_length=256, blank=True)), - ('accessibility_requirements', models.CharField(max_length=256, blank=True)), - ('gender', models.CharField(max_length=64, blank=True)), - ('profile', models.OneToOneField(to='registrasion.Attendee')), - ], - ), - migrations.RemoveField( - model_name='badge', - name='profile', - ), - migrations.RemoveField( - model_name='profile', - name='user', - ), - migrations.DeleteModel( - name='Badge', - ), - migrations.DeleteModel( - name='Profile', - ), - ] diff --git a/registrasion/migrations/0005_auto_20160323_2141.py b/registrasion/migrations/0005_auto_20160323_2141.py deleted file mode 100644 index 26124f7d..00000000 --- a/registrasion/migrations/0005_auto_20160323_2141.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0004_auto_20160323_2137'), - ] - - operations = [ - migrations.RenameField( - model_name='badgeandprofile', - old_name='profile', - new_name='attendee', - ), - ] diff --git a/registrasion/migrations/0006_category_required.py b/registrasion/migrations/0006_category_required.py deleted file mode 100644 index 46cc6a51..00000000 --- a/registrasion/migrations/0006_category_required.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0005_auto_20160323_2141'), - ] - - operations = [ - migrations.AddField( - model_name='category', - name='required', - field=models.BooleanField(default=False), - preserve_default=False, - ), - ] diff --git a/registrasion/migrations/0007_auto_20160326_2105.py b/registrasion/migrations/0007_auto_20160326_2105.py deleted file mode 100644 index dbcf2ac7..00000000 --- a/registrasion/migrations/0007_auto_20160326_2105.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0006_category_required'), - ] - - operations = [ - migrations.AddField( - model_name='category', - name='limit_per_user', - field=models.PositiveIntegerField(null=True, verbose_name='Limit per user', blank=True), - ), - migrations.AlterField( - model_name='product', - name='limit_per_user', - field=models.PositiveIntegerField(null=True, verbose_name='Limit per user', blank=True), - ), - ] diff --git a/registrasion/migrations/0008_cart_released.py b/registrasion/migrations/0008_cart_released.py deleted file mode 100644 index 1d805c94..00000000 --- a/registrasion/migrations/0008_cart_released.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0007_auto_20160326_2105'), - ] - - operations = [ - migrations.AddField( - model_name='cart', - name='released', - field=models.BooleanField(default=False), - ), - ] diff --git a/registrasion/migrations/0009_auto_20160330_2336.py b/registrasion/migrations/0009_auto_20160330_2336.py deleted file mode 100644 index 9d81a3b6..00000000 --- a/registrasion/migrations/0009_auto_20160330_2336.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import datetime - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0008_cart_released'), - ] - - operations = [ - migrations.AlterModelOptions( - name='category', - options={'verbose_name_plural': 'categories'}, - ), - migrations.AlterModelOptions( - name='timeorstocklimitenablingcondition', - options={'verbose_name': 'ceiling'}, - ), - migrations.AlterField( - model_name='category', - name='limit_per_user', - field=models.PositiveIntegerField(help_text='The total number of items from this category one attendee may purchase.', null=True, verbose_name='Limit per user', blank=True), - ), - migrations.AlterField( - model_name='category', - name='render_type', - field=models.IntegerField(help_text='The registration form will render this category in this style.', verbose_name='Render type', choices=[(1, 'Radio button'), (2, 'Quantity boxes')]), - ), - migrations.AlterField( - model_name='category', - name='required', - field=models.BooleanField(help_text='If enabled, a user must select an item from this category.'), - ), - migrations.AlterField( - model_name='categoryenablingcondition', - name='enabling_category', - field=models.ForeignKey(help_text='If a product from this category is purchased, this condition is met.', to='registrasion.Category'), - ), - migrations.AlterField( - model_name='discountbase', - name='description', - field=models.CharField(help_text='A description of this discount. This will be included on invoices where this discount is applied.', max_length=255, verbose_name='Description'), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='categories', - field=models.ManyToManyField(help_text='Categories whose products are enabled if this condition is met.', to='registrasion.Category', blank=True), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='mandatory', - field=models.BooleanField(default=False, help_text='If there is at least one mandatory condition defined on a product or category, all such conditions must be met. Otherwise, at least one non-mandatory condition must be met.'), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='products', - field=models.ManyToManyField(help_text='Products that are enabled if this condition is met.', to='registrasion.Product', blank=True), - ), - migrations.AlterField( - model_name='includedproductdiscount', - name='enabling_products', - field=models.ManyToManyField(help_text='If one of these products are purchased, the discounts below will be enabled.', to='registrasion.Product', verbose_name='Including product'), - ), - migrations.AlterField( - model_name='product', - name='description', - field=models.CharField(max_length=255, null=True, verbose_name='Description', blank=True), - ), - migrations.AlterField( - model_name='product', - name='reservation_duration', - field=models.DurationField(default=datetime.timedelta(0, 3600), help_text='The length of time this product will be reserved before it is released for someone else to purchase.', verbose_name='Reservation duration'), - ), - migrations.AlterField( - model_name='productenablingcondition', - name='enabling_products', - field=models.ManyToManyField(help_text='If one of these products are purchased, this condition is met.', to='registrasion.Product'), - ), - migrations.AlterField( - model_name='timeorstocklimitdiscount', - name='end_time', - field=models.DateTimeField(help_text='This discount will only be available before this time.', null=True, verbose_name='End time', blank=True), - ), - migrations.AlterField( - model_name='timeorstocklimitdiscount', - name='limit', - field=models.PositiveIntegerField(help_text='This discount may only be applied this many times.', null=True, verbose_name='Limit', blank=True), - ), - migrations.AlterField( - model_name='timeorstocklimitdiscount', - name='start_time', - field=models.DateTimeField(help_text='This discount will only be available after this time.', null=True, verbose_name='Start time', blank=True), - ), - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='end_time', - field=models.DateTimeField(help_text='Products included in this condition will only be available before this time.', null=True), - ), - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='limit', - field=models.PositiveIntegerField(help_text='The number of items under this grouping that can be purchased.', null=True), - ), - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='start_time', - field=models.DateTimeField(help_text='Products included in this condition will only be available after this time.', null=True), - ), - ] diff --git a/registrasion/migrations/0010_auto_20160330_2342.py b/registrasion/migrations/0010_auto_20160330_2342.py deleted file mode 100644 index f689504b..00000000 --- a/registrasion/migrations/0010_auto_20160330_2342.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0009_auto_20160330_2336'), - ] - - operations = [ - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='end_time', - field=models.DateTimeField(help_text='Products included in this condition will only be available before this time.', null=True, blank=True), - ), - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='limit', - field=models.PositiveIntegerField(help_text='The number of items under this grouping that can be purchased.', null=True, blank=True), - ), - migrations.AlterField( - model_name='timeorstocklimitenablingcondition', - name='start_time', - field=models.DateTimeField(help_text='Products included in this condition will only be available after this time.', null=True, blank=True), - ), - ] diff --git a/registrasion/migrations/0011_auto_20160401_0943.py b/registrasion/migrations/0011_auto_20160401_0943.py deleted file mode 100644 index a8b2deac..00000000 --- a/registrasion/migrations/0011_auto_20160401_0943.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-01 09:43 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0010_auto_20160330_2342'), - ] - - operations = [ - migrations.CreateModel( - name='AttendeeProfileBase', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('attendee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Attendee')), - ], - ), - migrations.RemoveField( - model_name='badgeandprofile', - name='attendee', - ), - migrations.DeleteModel( - name='BadgeAndProfile', - ), - ] diff --git a/registrasion/migrations/0012_auto_20160406_1212.py b/registrasion/migrations/0012_auto_20160406_1212.py deleted file mode 100644 index 61a27ed1..00000000 --- a/registrasion/migrations/0012_auto_20160406_1212.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-06 12:12 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0011_auto_20160401_0943'), - ] - - operations = [ - migrations.AlterField( - model_name='cart', - name='active', - field=models.BooleanField(db_index=True, default=True), - ), - migrations.AlterField( - model_name='cart', - name='released', - field=models.BooleanField(db_index=True, default=False), - ), - migrations.AlterField( - model_name='cart', - name='time_last_updated', - field=models.DateTimeField(db_index=True), - ), - migrations.AlterField( - model_name='category', - name='order', - field=models.PositiveIntegerField(db_index=True, verbose_name='Display order'), - ), - migrations.AlterField( - model_name='product', - name='order', - field=models.PositiveIntegerField(db_index=True, verbose_name='Display order'), - ), - migrations.AlterField( - model_name='productitem', - name='quantity', - field=models.PositiveIntegerField(db_index=True), - ), - migrations.AlterIndexTogether( - name='cart', - index_together=set([('active', 'released'), ('released', 'user'), ('active', 'user'), ('active', 'time_last_updated')]), - ), - ] diff --git a/registrasion/migrations/0013_auto_20160406_2228_squashed_0015_auto_20160406_1942.py b/registrasion/migrations/0013_auto_20160406_2228_squashed_0015_auto_20160406_1942.py deleted file mode 100644 index e4d88313..00000000 --- a/registrasion/migrations/0013_auto_20160406_2228_squashed_0015_auto_20160406_1942.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-07 03:13 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - replaces = [('registrasion', '0013_auto_20160406_2228'), ('registrasion', '0014_auto_20160406_1847'), ('registrasion', '0015_auto_20160406_1942')] - - dependencies = [ - ('registrasion', '0012_auto_20160406_1212'), - ] - - operations = [ - migrations.CreateModel( - name='PaymentBase', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('time', models.DateTimeField(default=django.utils.timezone.now)), - ('reference', models.CharField(max_length=255)), - ('amount', models.DecimalField(decimal_places=2, max_digits=8)), - ], - ), - migrations.RemoveField( - model_name='payment', - name='invoice', - ), - migrations.RemoveField( - model_name='invoice', - name='paid', - ), - migrations.RemoveField( - model_name='invoice', - name='void', - ), - migrations.AddField( - model_name='invoice', - name='due_time', - field=models.DateTimeField(default=django.utils.timezone.now), - preserve_default=False, - ), - migrations.AddField( - model_name='invoice', - name='issue_time', - field=models.DateTimeField(default=django.utils.timezone.now), - preserve_default=False, - ), - migrations.AddField( - model_name='invoice', - name='recipient', - field=models.CharField(default='Lol', max_length=1024), - preserve_default=False, - ), - migrations.AddField( - model_name='invoice', - name='status', - field=models.IntegerField(choices=[(1, 'Unpaid'), (2, 'Paid'), (3, 'Refunded'), (4, 'VOID')], db_index=True), - ), - migrations.AddField( - model_name='lineitem', - name='product', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='registrasion.Product'), - ), - migrations.CreateModel( - name='ManualPayment', - fields=[ - ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), - ], - bases=('registrasion.paymentbase',), - ), - migrations.DeleteModel( - name='Payment', - ), - migrations.AddField( - model_name='paymentbase', - name='invoice', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registrasion.Invoice'), - ), - migrations.AlterField( - model_name='invoice', - name='cart_revision', - field=models.IntegerField(db_index=True, null=True), - ), - ] diff --git a/registrasion/migrations/0014_attendee_access_code.py b/registrasion/migrations/0014_attendee_access_code.py deleted file mode 100644 index a579f47a..00000000 --- a/registrasion/migrations/0014_attendee_access_code.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-08 02:20 -from __future__ import unicode_literals - -from django.db import migrations, models -import registrasion.util - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0013_auto_20160406_2228_squashed_0015_auto_20160406_1942'), - ] - - operations = [ - migrations.AddField( - model_name='attendee', - name='access_code', - field=models.CharField(default=registrasion.util.generate_access_code, max_length=6, unique=True), - ), - ] diff --git a/registrasion/migrations/0015_auto_20160408_0220.py b/registrasion/migrations/0015_auto_20160408_0220.py deleted file mode 100644 index acdde45f..00000000 --- a/registrasion/migrations/0015_auto_20160408_0220.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-08 02:20 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0014_attendee_access_code'), - ] - - operations = [ - migrations.AlterField( - model_name='attendee', - name='access_code', - field=models.CharField(max_length=6, unique=True), - ), - ] diff --git a/registrasion/migrations/0016_auto_20160408_0234.py b/registrasion/migrations/0016_auto_20160408_0234.py deleted file mode 100644 index 94beb184..00000000 --- a/registrasion/migrations/0016_auto_20160408_0234.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-08 02:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0015_auto_20160408_0220'), - ] - - operations = [ - migrations.AlterField( - model_name='attendee', - name='access_code', - field=models.CharField(db_index=True, max_length=6, unique=True), - ), - ] diff --git a/registrasion/migrations/0017_auto_20160408_0731.py b/registrasion/migrations/0017_auto_20160408_0731.py deleted file mode 100644 index 5bb8957c..00000000 --- a/registrasion/migrations/0017_auto_20160408_0731.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-08 07:31 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0016_auto_20160408_0234'), - ] - - operations = [ - migrations.RemoveField( - model_name='attendee', - name='highest_complete_category', - ), - migrations.AddField( - model_name='attendee', - name='guided_categories_complete', - field=models.ManyToManyField(to='registrasion.Category'), - ), - ] diff --git a/registrasion/migrations/0018_creditnote_creditnoteapplication_creditnoterefund_squashed_0019_auto_20160410_0753.py b/registrasion/migrations/0018_creditnote_creditnoteapplication_creditnoterefund_squashed_0019_auto_20160410_0753.py deleted file mode 100644 index abb3b6e9..00000000 --- a/registrasion/migrations/0018_creditnote_creditnoteapplication_creditnoterefund_squashed_0019_auto_20160410_0753.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-10 07:54 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import django.utils.timezone - - -class Migration(migrations.Migration): - - replaces = [('registrasion', '0018_creditnote_creditnoteapplication_creditnoterefund'), ('registrasion', '0019_auto_20160410_0753')] - - dependencies = [ - ('registrasion', '0017_auto_20160408_0731'), - ] - - operations = [ - migrations.CreateModel( - name='CreditNote', - fields=[ - ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), - ], - bases=('registrasion.paymentbase',), - ), - migrations.CreateModel( - name='CreditNoteApplication', - fields=[ - ('paymentbase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.PaymentBase')), - ('parent', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.CreditNote')), - ], - bases=('registrasion.paymentbase',), - ), - migrations.CreateModel( - name='CreditNoteRefund', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('time', models.DateTimeField(default=django.utils.timezone.now)), - ('reference', models.CharField(max_length=255)), - ('parent', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='registrasion.CreditNote')), - ], - ), - ] diff --git a/registrasion/migrations/0019_manualcreditnoterefund_squashed_0020_auto_20160411_0256.py b/registrasion/migrations/0019_manualcreditnoterefund_squashed_0020_auto_20160411_0256.py deleted file mode 100644 index b070e3e6..00000000 --- a/registrasion/migrations/0019_manualcreditnoterefund_squashed_0020_auto_20160411_0256.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-11 02:57 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - replaces = [('registrasion', '0019_manualcreditnoterefund'), ('registrasion', '0020_auto_20160411_0256')] - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registrasion', '0018_creditnote_creditnoteapplication_creditnoterefund_squashed_0019_auto_20160410_0753'), - ] - - operations = [ - migrations.CreateModel( - name='ManualCreditNoteRefund', - fields=[ - ('entered_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ('creditnoterefund_ptr', models.OneToOneField(auto_created=True, default=0, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.CreditNoteRefund')), - ], - ), - ] diff --git a/registrasion/migrations/0020_auto_20160411_0258.py b/registrasion/migrations/0020_auto_20160411_0258.py deleted file mode 100644 index 0148f90d..00000000 --- a/registrasion/migrations/0020_auto_20160411_0258.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-11 02:58 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0019_manualcreditnoterefund_squashed_0020_auto_20160411_0256'), - ] - - operations = [ - migrations.AlterField( - model_name='manualcreditnoterefund', - name='creditnoterefund_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.CreditNoteRefund'), - ), - ] diff --git a/registrasion/migrations/0021_auto_20160411_0748_squashed_0024_auto_20160411_2230.py b/registrasion/migrations/0021_auto_20160411_0748_squashed_0024_auto_20160411_2230.py deleted file mode 100644 index 53b82d10..00000000 --- a/registrasion/migrations/0021_auto_20160411_0748_squashed_0024_auto_20160411_2230.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-11 22:46 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0020_auto_20160411_0258'), - ] - - operations = [ - migrations.RenameModel( - old_name='CategoryEnablingCondition', - new_name='CategoryFlag', - ), - migrations.RenameModel( - old_name='ProductEnablingCondition', - new_name='ProductFlag', - ), - migrations.RenameModel( - old_name='TimeOrStockLimitEnablingCondition', - new_name='TimeOrStockLimitFlag', - ), - migrations.RenameModel( - old_name='VoucherEnablingCondition', - new_name='VoucherFlag', - ), - migrations.AlterModelOptions( - name='categoryflag', - options={'verbose_name': 'flag (dependency on product from category)', 'verbose_name_plural': 'flags (dependency on product from category)'}, - ), - migrations.AlterModelOptions( - name='productflag', - options={'verbose_name': 'flag (dependency on product)', 'verbose_name_plural': 'flags (dependency on product)'}, - ), - migrations.AlterModelOptions( - name='timeorstocklimitflag', - options={'verbose_name': 'flag (time/stock limit)', 'verbose_name_plural': 'flags (time/stock limit)'}, - ), - migrations.AlterModelOptions( - name='voucherflag', - options={'verbose_name': 'flag (dependency on voucher)', 'verbose_name_plural': 'flags (dependency on voucher)'}, - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='categories', - field=models.ManyToManyField(blank=True, help_text="Categories whose products are affected by this flag's condition.", to=b'registrasion.Category'), - ), - migrations.RenameField( - model_name='enablingconditionbase', - old_name='mandatory', - new_name='condition', - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='condition', - field=models.IntegerField(choices=[(1, 'Disable if false'), (2, 'Enable if true')], default=2, help_text="If there is at least one 'disable if false' flag defined on a product or category, all such flag conditions must be met. If there is at least one 'enable if true' flag, at least one such condition must be met. If both types of conditions exist on a product, both of these rules apply."), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='products', - field=models.ManyToManyField(blank=True, help_text="Products affected by this flag's condition.", to=b'registrasion.Product'), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='categories', - field=models.ManyToManyField(blank=True, help_text="Categories whose products are affected by this flag's condition.", related_name='flagbase_set', to=b'registrasion.Category'), - ), - migrations.AlterField( - model_name='enablingconditionbase', - name='products', - field=models.ManyToManyField(blank=True, help_text="Products affected by this flag's condition.", related_name='flagbase_set', to=b'registrasion.Product'), - ), - ] diff --git a/registrasion/migrations/0021_auto_20160411_0820.py b/registrasion/migrations/0021_auto_20160411_0820.py deleted file mode 100644 index b6fc4367..00000000 --- a/registrasion/migrations/0021_auto_20160411_0820.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-11 08:20 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0020_auto_20160411_0258'), - ] - - operations = [ - migrations.AlterModelOptions( - name='category', - options={'ordering': ('order',), 'verbose_name': 'inventory - category', 'verbose_name_plural': 'inventory - categories'}, - ), - migrations.AlterModelOptions( - name='discountitem', - options={'ordering': ('product',)}, - ), - migrations.AlterModelOptions( - name='includedproductdiscount', - options={'verbose_name': 'discount (product inclusions)', 'verbose_name_plural': 'discounts (product inclusions)'}, - ), - migrations.AlterModelOptions( - name='lineitem', - options={'ordering': ('id',)}, - ), - migrations.AlterModelOptions( - name='paymentbase', - options={'ordering': ('time',)}, - ), - migrations.AlterModelOptions( - name='product', - options={'ordering': ('category__order', 'order'), 'verbose_name': 'inventory - product'}, - ), - migrations.AlterModelOptions( - name='productitem', - options={'ordering': ('product',)}, - ), - migrations.AlterModelOptions( - name='timeorstocklimitdiscount', - options={'verbose_name': 'discount (time/stock limit)', 'verbose_name_plural': 'discounts (time/stock limit)'}, - ), - migrations.AlterModelOptions( - name='voucherdiscount', - options={'verbose_name': 'discount (enabled by voucher)', 'verbose_name_plural': 'discounts (enabled by voucher)'}, - ), - ] diff --git a/registrasion/migrations/0022_merge.py b/registrasion/migrations/0022_merge.py deleted file mode 100644 index e3c30039..00000000 --- a/registrasion/migrations/0022_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-12 01:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0021_auto_20160411_0748_squashed_0024_auto_20160411_2230'), - ('registrasion', '0021_auto_20160411_0820'), - ] - - operations = [ - ] diff --git a/registrasion/migrations/0023_auto_20160425_0409.py b/registrasion/migrations/0023_auto_20160425_0409.py deleted file mode 100644 index 234e9cda..00000000 --- a/registrasion/migrations/0023_auto_20160425_0409.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-25 04:09 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0022_merge'), - ] - - operations = [ - migrations.AlterIndexTogether( - name='cart', - index_together=set([]), - ), - ] diff --git a/registrasion/migrations/0024_auto_20160425_0410.py b/registrasion/migrations/0024_auto_20160425_0410.py deleted file mode 100644 index 5cf7cdbc..00000000 --- a/registrasion/migrations/0024_auto_20160425_0410.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-25 04:10 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0023_auto_20160425_0409'), - ] - - operations = [ - migrations.AddField( - model_name='cart', - name='status', - field=models.IntegerField(choices=[(1, 'Active'), (2, 'Paid'), (3, 'Released')], db_index=True, default=1), - preserve_default=False, - ), - migrations.RemoveField( - model_name='cart', - name='active', - ), - migrations.RemoveField( - model_name='cart', - name='released', - ), - migrations.AlterIndexTogether( - name='cart', - index_together=set([('status', 'user'), ('status', 'time_last_updated')]), - ), - ] diff --git a/registrasion/migrations/0025_auto_20160425_0411.py b/registrasion/migrations/0025_auto_20160425_0411.py deleted file mode 100644 index aa084246..00000000 --- a/registrasion/migrations/0025_auto_20160425_0411.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-25 04:11 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('registrasion', '0024_auto_20160425_0410'), - ] - - operations = [ - migrations.AlterField( - model_name='cart', - name='status', - field=models.IntegerField(choices=[(1, 'Active'), (2, 'Paid'), (3, 'Released')], db_index=True, default=1), - ), - ] diff --git a/registrasion/migrations/0026_manualpayment_entered_by.py b/registrasion/migrations/0026_manualpayment_entered_by.py deleted file mode 100644 index 0e068b17..00000000 --- a/registrasion/migrations/0026_manualpayment_entered_by.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-04-25 06:05 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('registrasion', '0025_auto_20160425_0411'), - ] - - operations = [ - migrations.AddField( - model_name='manualpayment', - name='entered_by', - field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - preserve_default=False, - ), - ] diff --git a/registrasion/models/commerce.py b/registrasion/models/commerce.py index 7e86acf2..a9fc7341 100644 --- a/registrasion/models/commerce.py +++ b/registrasion/models/commerce.py @@ -102,7 +102,39 @@ class DiscountItem(models.Model): @python_2_unicode_compatible class Invoice(models.Model): ''' An invoice. Invoices can be automatically generated when checking out - a Cart, in which case, it is attached to a given revision of a Cart. ''' + a Cart, in which case, it is attached to a given revision of a Cart. + + Attributes: + + user (User): The owner of this invoice. + + cart (commerce.Cart): The cart that was used to generate this invoice. + + cart_revision (int): The value of ``cart.revision`` at the time of this + invoice's creation. If a change is made to the underlying cart, + this invoice is automatically void -- this change is detected + when ``cart.revision != cart_revision``. + + status (int): One of ``STATUS_UNPAID``, ``STATUS_PAID``, + ``STATUS_REFUNDED``, OR ``STATUS_VOID``. Call + ``get_status_display`` for a human-readable representation. + + recipient (str): A rendered representation of the invoice's recipient. + + issue_time (datetime): When the invoice was issued. + + due_time (datetime): When the invoice is due. + + value (Decimal): The total value of the line items attached to the + invoice. + + lineitem_set (Queryset[LineItem]): The set of line items that comprise + this invoice. + + paymentbase_set(Queryset[PaymentBase]): The set of PaymentBase objects + that have been applied to this invoice. + + ''' class Meta: app_label = "registrasion" @@ -165,7 +197,24 @@ class Invoice(models.Model): class LineItem(models.Model): ''' Line items for an invoice. These are denormalised from the ProductItems and DiscountItems that belong to a cart (for consistency), but also allow - for arbitrary line items when required. ''' + for arbitrary line items when required. + + Attributes: + + invoice (commerce.Invoice): The invoice to which this LineItem is + attached. + + description (str): A human-readable description of the line item. + + quantity (int): The quantity of items represented by this line. + + price (Decimal): The per-unit price for this line item. + + product (Optional[inventory.Product]): The product that this LineItem + applies to. This allows you to do reports on sales and applied + discounts to individual products. + + ''' class Meta: app_label = "registrasion" diff --git a/registrasion/models/conditions.py b/registrasion/models/conditions.py index 2186ef1d..41e1a320 100644 --- a/registrasion/models/conditions.py +++ b/registrasion/models/conditions.py @@ -279,10 +279,7 @@ class FlagBase(models.Model): The Categories whose Products are affected by this flag. ''' - class Meta: - # TODO: make concrete once https://code.djangoproject.com/ticket/26488 - # is solved. - abstract = True + objects = InheritanceManager() DISABLE_IF_FALSE = 1 ENABLE_IF_TRUE = 2 @@ -333,19 +330,7 @@ class FlagBase(models.Model): ) -class EnablingConditionBase(FlagBase): - ''' Reifies the abstract FlagBase. This is necessary because django - prevents renaming base classes in migrations. ''' - # TODO: remove this, and make subclasses subclass FlagBase once - # https://code.djangoproject.com/ticket/26488 is solved. - - class Meta: - app_label = "registrasion" - - objects = InheritanceManager() - - -class TimeOrStockLimitFlag(EnablingConditionBase): +class TimeOrStockLimitFlag(FlagBase): ''' Product groupings that can be used to enable a product during a specific date range, or when fewer than a limit of products have been sold. @@ -388,7 +373,7 @@ class TimeOrStockLimitFlag(EnablingConditionBase): @python_2_unicode_compatible -class ProductFlag(EnablingConditionBase): +class ProductFlag(FlagBase): ''' The condition is met because a specific product is purchased. Attributes: @@ -412,7 +397,7 @@ class ProductFlag(EnablingConditionBase): @python_2_unicode_compatible -class CategoryFlag(EnablingConditionBase): +class CategoryFlag(FlagBase): ''' The condition is met because a product in a particular product is purchased. @@ -437,7 +422,7 @@ class CategoryFlag(EnablingConditionBase): @python_2_unicode_compatible -class VoucherFlag(EnablingConditionBase): +class VoucherFlag(FlagBase): ''' The condition is met because a Voucher is present. This is for e.g. enabling sponsor tickets. ''' diff --git a/registrasion/tests/test_cart.py b/registrasion/tests/test_cart.py index 790c1df9..507d5cf7 100644 --- a/registrasion/tests/test_cart.py +++ b/registrasion/tests/test_cart.py @@ -26,7 +26,7 @@ class RegistrationCartTestCase(SetTimeMixin, TestCase): super(RegistrationCartTestCase, self).setUp() def tearDown(self): - if True: + if False: # If you're seeing segfaults in tests, enable this. call_command( 'flush',