Modifies the Category model to allow for ITEM_QUANTITY forms

This commit is contained in:
Christopher Neugebauer 2016-08-22 10:35:30 +10:00
parent c4274817a8
commit d9f9af9827
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-08-22 00:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registrasion', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='category',
name='render_type',
field=models.IntegerField(choices=[(1, 'Radio button'), (2, 'Quantity boxes'), (3, 'Product selector and quantity box')], help_text='The registration form will render this category in this style.', verbose_name='Render type'),
),
]

View file

@ -36,6 +36,12 @@ class Category(models.Model):
where the user can specify a quantity of each Product type. This is where the user can specify a quantity of each Product type. This is
useful for additional extras, like Dinner Tickets. useful for additional extras, like Dinner Tickets.
``RENDER_TYPE_ITEM_QUANTITY`` shows a select menu to select a
Product type, and an input field, where the user can specify the
quantity for that Product type. This is useful for categories that
have a lot of options, from which the user is not going to select
all of the options.
limit_per_user (Optional[int]): This restricts the number of items limit_per_user (Optional[int]): This restricts the number of items
from this Category that each attendee may claim. This extends from this Category that each attendee may claim. This extends
across multiple Invoices. across multiple Invoices.
@ -56,10 +62,12 @@ class Category(models.Model):
RENDER_TYPE_RADIO = 1 RENDER_TYPE_RADIO = 1
RENDER_TYPE_QUANTITY = 2 RENDER_TYPE_QUANTITY = 2
RENDER_TYPE_ITEM_QUANTITY = 3
CATEGORY_RENDER_TYPES = [ CATEGORY_RENDER_TYPES = [
(RENDER_TYPE_RADIO, _("Radio button")), (RENDER_TYPE_RADIO, _("Radio button")),
(RENDER_TYPE_QUANTITY, _("Quantity boxes")), (RENDER_TYPE_QUANTITY, _("Quantity boxes")),
(RENDER_TYPE_ITEM_QUANTITY, _("Product selector and quantity box")),
] ]
name = models.CharField( name = models.CharField(