symposion_app/pinaxcon/registrasion/migrations/0001_initial.py

96 lines
5.3 KiB
Python
Raw Normal View History

Adds registration to the website (#69) * Updates settings and requirements * First pass at attendee profile * Imports the registration templates; defines attendee profile models etc. * First pass at themeing the registration form. * First page of the registration form: done! * Makes form validation nicer * Adds populate_inventory * Improves the additional items page * Allows for rendering of formsets. * Adds support for formset extending. * Removes formset delete buttons * Review page is LCA-ified * Fixes some formset behaviour * Fixes urls.py * LCA-ifies product_category.html * Invoices * Credit card payments * s/register/tickets/ * Show registration features only whilst products are available (think about this better, later) * Updates the attendee profile form page * Form tidy-up * Makes it so that address info is copied from attendee profile to the address details are autofilled in Stripe. * Adds feature to offer Australians a dropdown list of states rather than free text. * Allow toggling of void invoices. * Adds backgrounds to the headers in the registration process * Improves the review page * Adds “Linux Australia” to invoice details. * Do not show balance due on void/refunded invoices. * More thumbing * Adds a link back to reports on each report. * Tokenisation language. * Another bug in credit card processing. * Adds stripe refunds to options * Removes spurious dashboard button. * Tidies up the presentation of discounts. * Tidies up presentation of voucher form. * Fixes sponsor logo appearance with adblock. * Front page tweaks * Lets us specify alternative URLs in homepage panels * more * Updates discount amounts. * More website fixes * Changes language on pay invoice button * Adds contact details to the invoice template. * Updates the currency message in the invoice template. * Explicitly includes e-mail address, because theme_contact_email doesn’t propagate * Changes payment text. * s/registration/selections/ * Removes final face palm * Fixes lack of speaker dinner tickets for actual presenters. * Adjusts wording in invoice e-mails * Invoice wording. * (FIX) * Fixes margins on lists and tables * Improvements arising from those CSS fixes. * Changes description tags.
2016-09-30 10:46:05 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-22 06:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
_PAST_EVENTS = (
(1999, "1999 Melbourne (CALU)"),
(2001, "2001 Sydney"),
(2002, "2002 Brisbane"),
(2003, "2003 Perth"),
(2004, "2004 Adelaide"),
(2005, "2005 Canberra"),
(2006, "2006 Dunedin"),
(2007, "2007 Sydney"),
(2008, "2008 Melbourne"),
(2009, "2009 Hobart"),
(2010, "2010 Wellington"),
(2011, "2011 Brisbane"),
(2012, "2012 Ballarat"),
(2013, "2013 Canberra"),
(2014, "2014 Perth"),
(2015, "2015 Auckland"),
(2016, "2016 Geelong"),
(2017, "2017 Hobart"),
Adds registration to the website (#69) * Updates settings and requirements * First pass at attendee profile * Imports the registration templates; defines attendee profile models etc. * First pass at themeing the registration form. * First page of the registration form: done! * Makes form validation nicer * Adds populate_inventory * Improves the additional items page * Allows for rendering of formsets. * Adds support for formset extending. * Removes formset delete buttons * Review page is LCA-ified * Fixes some formset behaviour * Fixes urls.py * LCA-ifies product_category.html * Invoices * Credit card payments * s/register/tickets/ * Show registration features only whilst products are available (think about this better, later) * Updates the attendee profile form page * Form tidy-up * Makes it so that address info is copied from attendee profile to the address details are autofilled in Stripe. * Adds feature to offer Australians a dropdown list of states rather than free text. * Allow toggling of void invoices. * Adds backgrounds to the headers in the registration process * Improves the review page * Adds “Linux Australia” to invoice details. * Do not show balance due on void/refunded invoices. * More thumbing * Adds a link back to reports on each report. * Tokenisation language. * Another bug in credit card processing. * Adds stripe refunds to options * Removes spurious dashboard button. * Tidies up the presentation of discounts. * Tidies up presentation of voucher form. * Fixes sponsor logo appearance with adblock. * Front page tweaks * Lets us specify alternative URLs in homepage panels * more * Updates discount amounts. * More website fixes * Changes language on pay invoice button * Adds contact details to the invoice template. * Updates the currency message in the invoice template. * Explicitly includes e-mail address, because theme_contact_email doesn’t propagate * Changes payment text. * s/registration/selections/ * Removes final face palm * Fixes lack of speaker dinner tickets for actual presenters. * Adjusts wording in invoice e-mails * Invoice wording. * (FIX) * Fixes margins on lists and tables * Improvements arising from those CSS fixes. * Changes description tags.
2016-09-30 10:46:05 +00:00
)
def populate(apps, schema_editor):
PastEvent = apps.get_model("pinaxcon_registrasion","PastEvent")
all_such = PastEvent.objects.all()
by_year = dict((event.year, event) for event in all_such)
events = []
for past_event in _PAST_EVENTS:
if past_event[0] in by_year:
continue
events.append(PastEvent(
year=past_event[0],
name=past_event[1],
))
PastEvent.objects.bulk_create(events)
class Migration(migrations.Migration):
initial = True
dependencies = [
('registrasion', '0005_auto_20160905_0945'),
]
operations = [
migrations.CreateModel(
name='AttendeeProfile',
fields=[
('attendeeprofilebase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registrasion.AttendeeProfileBase')),
('name', models.CharField(help_text=b"Your name, as you'd like it to appear on your badge. ", max_length=64, verbose_name=b'Your name (for your conference nametag)')),
('company', models.CharField(blank=True, help_text=b"The name of your company, as you'd like it on your badge", max_length=64)),
('state', models.CharField(choices=[(b'', b'Not in Australia'), (b'TAS', b'Tasmania'), (b'ACT', b'Australian Capital Territory'), (b'NSW', b'New South Wales'), (b'NT', b'Northern Territory'), (b'QLD', b'Queensland'), (b'SA', b'South Australia'), (b'VIC', b'Victoria'), (b'WA', b'Western Australia')], max_length=4, verbose_name=b'Australian State/Territory')),
('country', django_countries.fields.CountryField(max_length=2)),
('free_text_1', models.CharField(blank=True, help_text=b"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=b'Free text line 1')),
('free_text_2', models.CharField(blank=True, max_length=64, verbose_name=b'Free text line 2')),
('name_per_invoice', models.CharField(blank=True, help_text=b"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=256, verbose_name=b'Your legal name (for invoicing purposes)')),
('address', models.TextField(blank=True, help_text=b'This address, if provided, will appear on your invoices.', verbose_name=b'Invoicing address')),
('of_legal_age', models.BooleanField(default=False, help_text=b'Being under 18 will not stop you from attending the conference. We need to know whether you are over 18 to allow us to cater for you at venues that serve alcohol.', verbose_name=b'Are you over 18?')),
('dietary_restrictions', models.TextField(blank=True, max_length=256, verbose_name=b'Food allergies, intolerances, or dietary restrictions')),
('accessibility_requirements', models.TextField(blank=True, verbose_name=b'Accessibility-related requirements')),
('gender', models.CharField(blank=True, help_text=b'Gender data will only be used for demographic purposes.', max_length=64)),
('linux_australia', models.BooleanField(help_text=b"Select this field to register for free <a href='http://www.linux.org.au/'>Linux Australia</a> membership.", verbose_name=b'Linux Australia membership')),
('lca_announce', models.BooleanField(help_text=b'Select to be subscribed to the low-traffic lca-announce mailing list', verbose_name=b'Subscribe to lca-announce list')),
('lca_chat', models.BooleanField(help_text=b'lca2017-chat is a high-traffic mailing list used by attendees during the week of the conference for general discussion.', verbose_name=b'Subscribe to the lca2017-chat list')),
],
bases=('registrasion.attendeeprofilebase',),
),
migrations.CreateModel(
name='PastEvent',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('year', models.IntegerField(unique=True)),
('name', models.CharField(max_length=255, unique=True)),
],
),
migrations.AddField(
model_name='attendeeprofile',
name='past_lca',
field=models.ManyToManyField(blank=True, to='pinaxcon_registrasion.PastEvent', verbose_name=b'Which past linux.conf.au events have you attended?'),
),
migrations.RunPython(populate),
]