('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('foldable', models.BooleanField(default=False)),
- ('accountclass', models.ForeignKey(default=False, to='accounting.AccountClass')),
+ ('accountclass', models.ForeignKey(default=False, to='accounting.AccountClass', on_delete=models.CASCADE)),
],
options={
'ordering': ('name',),
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('amount', models.DecimalField(max_digits=10, decimal_places=2, validators=[postgresqleu.accounting.models.nonzero_validator])),
- ('account', models.ForeignKey(to='accounting.Account', to_field=b'num')),
+ ('account', models.ForeignKey(to='accounting.Account', to_field=b'num', on_delete=models.CASCADE)),
],
options={
'ordering': ('year__pk', 'account'),
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('amount', models.DecimalField(max_digits=10, decimal_places=2, validators=[postgresqleu.accounting.models.nonzero_validator])),
('description', models.CharField(max_length=200)),
- ('account', models.ForeignKey(to='accounting.Account', to_field=b'num')),
- ('journal', models.ForeignKey(to='accounting.JournalEntry')),
+ ('account', models.ForeignKey(to='accounting.Account', to_field=b'num', on_delete=models.CASCADE)),
+ ('journal', models.ForeignKey(to='accounting.JournalEntry', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('url', models.URLField()),
- ('journal', models.ForeignKey(to='accounting.JournalEntry')),
+ ('journal', models.ForeignKey(to='accounting.JournalEntry', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
migrations.AddField(
model_name='journalitem',
name='object',
- field=models.ForeignKey(blank=True, to='accounting.Object', null=True),
+ field=models.ForeignKey(blank=True, to='accounting.Object', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='journalentry',
name='year',
- field=models.ForeignKey(to='accounting.Year'),
+ field=models.ForeignKey(to='accounting.Year', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='incomingbalance',
name='year',
- field=models.ForeignKey(to='accounting.Year'),
+ field=models.ForeignKey(to='accounting.Year', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='account',
name='group',
- field=models.ForeignKey(to='accounting.AccountGroup'),
+ field=models.ForeignKey(to='accounting.AccountGroup', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='journalentry',
class AccountGroup(models.Model):
name = models.CharField(max_length=100)
- accountclass = models.ForeignKey(AccountClass, blank=False, default=False)
+ accountclass = models.ForeignKey(AccountClass, blank=False, default=False, on_delete=models.CASCADE)
foldable = models.BooleanField(null=False, blank=False, default=False)
def __unicode__(self):
class Account(models.Model):
num = models.IntegerField(verbose_name="Account number", unique=True)
- group = models.ForeignKey(AccountGroup, null=False, blank=False)
+ group = models.ForeignKey(AccountGroup, null=False, blank=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100)
availableforinvoicing = models.BooleanField(null=False, blank=False, default=False)
objectrequirement = models.IntegerField(null=False, default=0, choices=ACCOUNT_OBJECT_CHOICES, verbose_name="Object requirements")
ordering = ('-year',)
class IncomingBalance(models.Model):
- year = models.ForeignKey(Year, null=False, blank=False)
- account = models.ForeignKey(Account, to_field='num', null=False, blank=False)
+ year = models.ForeignKey(Year, null=False, blank=False, on_delete=models.CASCADE)
+ account = models.ForeignKey(Account, to_field='num', null=False, blank=False, on_delete=models.CASCADE)
amount = models.DecimalField(max_digits=10, decimal_places=2, null=False, blank=False, validators=[nonzero_validator,])
def __unicode__(self):
ordering = ('name', )
class JournalEntry(models.Model):
- year = models.ForeignKey(Year, null=False, blank=False)
+ year = models.ForeignKey(Year, null=False, blank=False, on_delete=models.CASCADE)
seq = models.IntegerField(null=False, blank=False)
date = models.DateField(null=False, blank=False)
closed = models.BooleanField(blank=False, null=False, default=False)
class JournalItem(models.Model):
- journal = models.ForeignKey(JournalEntry, null=False, blank=False)
- account = models.ForeignKey(Account, to_field='num', null=False, blank=False)
+ journal = models.ForeignKey(JournalEntry, null=False, blank=False, on_delete=models.CASCADE)
+ account = models.ForeignKey(Account, to_field='num', null=False, blank=False, on_delete=models.CASCADE)
amount = models.DecimalField(max_digits=10, decimal_places=2, null=False, blank=False, validators=[nonzero_validator,])
- object = models.ForeignKey(Object, null=True, blank=True)
+ object = models.ForeignKey(Object, null=True, blank=True, on_delete=models.CASCADE)
description = models.CharField(max_length=200, null=False, blank=False)
@property
return ""
class JournalUrl(models.Model):
- journal = models.ForeignKey(JournalEntry, null=False, blank=False)
+ journal = models.ForeignKey(JournalEntry, null=False, blank=False, on_delete=models.CASCADE)
url = models.URLField(null=False, blank=False)
def __unicode__(self):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('receivedat', models.DateTimeField(auto_now_add=True)),
('refund_amount', models.IntegerField()),
- ('notification', models.ForeignKey(to='adyen.Notification')),
+ ('notification', models.ForeignKey(to='adyen.Notification', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('downloadedat', models.DateTimeField(null=True, blank=True)),
('contents', models.TextField(null=True, blank=True)),
('processedat', models.DateTimeField(null=True, blank=True)),
- ('notification', models.ForeignKey(to='adyen.Notification')),
+ ('notification', models.ForeignKey(to='adyen.Notification', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('method', models.CharField(max_length=100, null=True, blank=True)),
('notes', models.CharField(max_length=1000, null=True, blank=True)),
('accounting_object', models.CharField(max_length=30, null=True, blank=True)),
- ('notification', models.ForeignKey(to='adyen.Notification')),
+ ('notification', models.ForeignKey(to='adyen.Notification', on_delete=models.CASCADE)),
],
options={
'verbose_name_plural': 'Transaction statuses',
migrations.AddField(
model_name='refund',
name='transaction',
- field=models.OneToOneField(to='adyen.TransactionStatus'),
+ field=models.OneToOneField(to='adyen.TransactionStatus', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='notification',
name='rawnotification',
- field=models.ForeignKey(blank=True, to='adyen.RawNotification', null=True),
+ field=models.ForeignKey(blank=True, to='adyen.RawNotification', null=True, on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='notification',
class Notification(models.Model):
receivedat = models.DateTimeField(null=False, blank=False, auto_now_add=True, unique=True)
- rawnotification = models.ForeignKey(RawNotification, null=True, blank=True)
+ rawnotification = models.ForeignKey(RawNotification, null=True, blank=True, on_delete=models.CASCADE)
eventDate = models.DateTimeField(null=False, blank=False)
eventCode = models.CharField(max_length=100, null=False, blank=False)
live = models.BooleanField(null=False)
class Report(models.Model):
receivedat = models.DateTimeField(null=False, blank=False, auto_now_add=True)
- notification = models.ForeignKey(Notification, null=False, blank=False)
+ notification = models.ForeignKey(Notification, null=False, blank=False, on_delete=models.CASCADE)
url = models.CharField(max_length=1000, null=False, blank=False)
downloadedat = models.DateTimeField(null=True, blank=True)
contents = models.TextField(null=True, blank=True)
class TransactionStatus(models.Model):
pspReference = models.CharField(max_length=100, null=False, blank=False, unique=True)
- notification = models.ForeignKey(Notification, null=False, blank=False)
+ notification = models.ForeignKey(Notification, null=False, blank=False, on_delete=models.CASCADE)
authorizedat = models.DateTimeField(null=False, blank=False)
capturedat = models.DateTimeField(null=True, blank=True)
settledat = models.DateTimeField(null=True, blank=True)
class Refund(models.Model):
receivedat = models.DateTimeField(null=False, blank=False, auto_now_add=True)
- notification = models.ForeignKey(Notification, null=False, blank=False)
- transaction = models.OneToOneField(TransactionStatus)
+ notification = models.ForeignKey(Notification, null=False, blank=False, on_delete=models.CASCADE)
+ transaction = models.OneToOneField(TransactionStatus, on_delete=models.CASCADE)
refund_amount = models.DecimalField(decimal_places=2, max_digits=20, null=False)
def __unicode__(self):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('buyername', models.CharField(max_length=100, null=True, blank=True)),
- ('buyer', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('buyer', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'ordering': ['conference', 'id'],
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('vouchervalue', models.CharField(unique=True, max_length=100)),
('usedate', models.DateTimeField(null=True, blank=True)),
- ('batch', models.ForeignKey(to='confreg.PrepaidBatch')),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('batch', models.ForeignKey(to='confreg.PrepaidBatch', on_delete=models.CASCADE)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'ordering': ['batch', 'vouchervalue'],
('regclass', models.CharField(max_length=64, verbose_name="Registration class")),
('badgecolor', models.CharField(blank=True, verbose_name="Badge color", help_text=b'Badge background color in hex format', max_length=20, validators=[postgresqleu.confreg.models.color_validator])),
('badgeforegroundcolor', models.CharField(blank=True, verbose_name="Badge foreground", help_text=b'Badge foreground color in hex format', max_length=20, validators=[postgresqleu.confreg.models.color_validator])),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'verbose_name_plural': 'Registration classes',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('day', models.DateField()),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'ordering': ('day',),
('alertmessage', models.TextField(blank=True)),
('upsell_target', models.BooleanField(default=False, help_text=b'Is target registration type for upselling in order to add additional options')),
('invoice_autocancel_hours', models.IntegerField(blank=True, help_text=b'Automatically cancel invoices after this many hours', null=True, verbose_name=b'Autocancel invoices', validators=[django.core.validators.MinValueValidator(1)])),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
('days', models.ManyToManyField(to='confreg.RegistrationDay', blank=True)),
- ('regclass', models.ForeignKey(blank=True, to='confreg.RegistrationClass', null=True)),
+ ('regclass', models.ForeignKey(blank=True, to='confreg.RegistrationClass', null=True, on_delete=models.CASCADE)),
('requires_option', models.ManyToManyField(help_text=b'Requires at least one of the selected additional options to be picked', to='confreg.ConferenceAdditionalOption', blank=True)),
],
options={
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('roomname', models.CharField(max_length=20)),
('sortkey', models.IntegerField(default=100)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'ordering': ['sortkey', 'roomname'],
('color', models.CharField(blank=True, max_length=20, validators=[postgresqleu.confreg.models.color_validator])),
('sortkey', models.IntegerField(default=100)),
('incfp', models.BooleanField(default=False)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
name='RegistrationWaitlistEntry',
fields=[
- ('registration', models.OneToOneField(primary_key=True, serialize=False, to='confreg.ConferenceRegistration')),
+ ('registration', models.OneToOneField(primary_key=True, serialize=False, to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
('enteredon', models.DateTimeField(auto_now_add=True)),
('offeredon', models.DateTimeField(null=True, blank=True)),
('offerexpires', models.DateTimeField(null=True, blank=True)),
migrations.CreateModel(
name='Speaker_Photo',
fields=[
- ('speaker', models.OneToOneField(primary_key=True, db_column=b'id', serialize=False, to='confreg.Speaker')),
+ ('speaker', models.OneToOneField(primary_key=True, db_column=b'id', serialize=False, to='confreg.Speaker', on_delete=models.CASCADE)),
('photo', models.TextField()),
],
),
migrations.AddField(
model_name='speaker',
name='user',
- field=models.OneToOneField(null=True, blank=True, to=settings.AUTH_USER_MODEL),
+ field=models.OneToOneField(null=True, blank=True, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='prepaidvoucher',
name='user',
- field=models.ForeignKey(blank=True, to='confreg.ConferenceRegistration', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.ConferenceRegistration', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='prepaidbatch',
name='regtype',
- field=models.ForeignKey(to='confreg.RegistrationType'),
+ field=models.ForeignKey(to='confreg.RegistrationType', on_delete=models.CASCADE),
),
]
migrations.AddField(
model_name='prepaidbatch',
name='sponsor',
- field=models.ForeignKey(verbose_name=b'Optional sponsor', blank=True, to='confsponsor.Sponsor', null=True),
+ field=models.ForeignKey(verbose_name=b'Optional sponsor', blank=True, to='confsponsor.Sponsor', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='pendingadditionalorder',
name='invoice',
- field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True),
+ field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='pendingadditionalorder',
name='newregtype',
- field=models.ForeignKey(blank=True, to='confreg.RegistrationType', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.RegistrationType', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='pendingadditionalorder',
migrations.AddField(
model_name='pendingadditionalorder',
name='reg',
- field=models.ForeignKey(to='confreg.ConferenceRegistration'),
+ field=models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='discountcode',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='discountcode',
migrations.AddField(
model_name='discountcode',
name='sponsor',
- field=models.ForeignKey(blank=True, to='confsponsor.Sponsor', help_text=b'Note that if a sponsor is picked, an invoice will be generated once the discount code closes!!!', null=True, verbose_name=b'Optional sponsor.'),
+ field=models.ForeignKey(blank=True, to='confsponsor.Sponsor', help_text=b'Note that if a sponsor is picked, an invoice will be generated once the discount code closes!!!', null=True, verbose_name=b'Optional sponsor.', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='discountcode',
name='sponsor_rep',
- field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text=b'Must be set if the sponsor field is set!', null=True, verbose_name=b'Optional sponsor representative.'),
+ field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, help_text=b'Must be set if the sponsor field is set!', null=True, verbose_name=b'Optional sponsor representative.', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionvote',
name='session',
- field=models.ForeignKey(to='confreg.ConferenceSession'),
+ field=models.ForeignKey(to='confreg.ConferenceSession', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionvote',
name='voter',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionscheduleslot',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionfeedback',
name='attendee',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionfeedback',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesessionfeedback',
name='session',
- field=models.ForeignKey(to='confreg.ConferenceSession'),
+ field=models.ForeignKey(to='confreg.ConferenceSession', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesession',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesession',
name='room',
- field=models.ForeignKey(blank=True, to='confreg.Room', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.Room', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesession',
migrations.AddField(
model_name='conferencesession',
name='tentativeroom',
- field=models.ForeignKey(related_name='tentativeroom', blank=True, to='confreg.Room', null=True),
+ field=models.ForeignKey(related_name='tentativeroom', blank=True, to='confreg.Room', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesession',
name='tentativescheduleslot',
- field=models.ForeignKey(blank=True, to='confreg.ConferenceSessionScheduleSlot', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.ConferenceSessionScheduleSlot', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencesession',
name='track',
- field=models.ForeignKey(blank=True, to='confreg.Track', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.Track', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
migrations.AddField(
model_name='conferenceregistration',
name='attendee',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='bulkpayment',
- field=models.ForeignKey(blank=True, to='confreg.BulkPayment', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.BulkPayment', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='country',
- field=models.ForeignKey(verbose_name=b'Country', to='countries.Country'),
+ field=models.ForeignKey(verbose_name=b'Country', to='countries.Country', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='invoice',
- field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True),
+ field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='regtype',
- field=models.ForeignKey(verbose_name=b'Registration type', blank=True, to='confreg.RegistrationType', null=True),
+ field=models.ForeignKey(verbose_name=b'Registration type', blank=True, to='confreg.RegistrationType', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceregistration',
name='shirtsize',
- field=models.ForeignKey(verbose_name=b'Preferred T-shirt size', blank=True, to='confreg.ShirtSize', null=True),
+ field=models.ForeignKey(verbose_name=b'Preferred T-shirt size', blank=True, to='confreg.ShirtSize', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencefeedbackquestion',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencefeedbackanswer',
name='attendee',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencefeedbackanswer',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferencefeedbackanswer',
name='question',
- field=models.ForeignKey(to='confreg.ConferenceFeedbackQuestion'),
+ field=models.ForeignKey(to='confreg.ConferenceFeedbackQuestion', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceadditionaloption',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conferenceadditionaloption',
migrations.AddField(
model_name='bulkpayment',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='bulkpayment',
name='invoice',
- field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True),
+ field=models.ForeignKey(blank=True, to='invoices.Invoice', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='bulkpayment',
name='user',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='attendeemail',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='attendeemail',
migrations.AddField(
model_name='registrationwaitlisthistory',
name='waitlist',
- field=models.ForeignKey(to='confreg.RegistrationWaitlistEntry'),
+ field=models.ForeignKey(to='confreg.RegistrationWaitlistEntry', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='discountcode',
migrations.AddField(
model_name='conference',
name='vat_registrations',
- field=models.ForeignKey(related_name='vat_registrations', verbose_name=b'VAT rate for registrations', blank=True, to='invoices.VatRate', null=True),
+ field=models.ForeignKey(related_name='vat_registrations', verbose_name=b'VAT rate for registrations', blank=True, to='invoices.VatRate', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conference',
name='vat_sponsorship',
- field=models.ForeignKey(related_name='vat_sponsorship', verbose_name=b'VAT rate for sponsorships', blank=True, to='invoices.VatRate', null=True),
+ field=models.ForeignKey(related_name='vat_sponsorship', verbose_name=b'VAT rate for sponsorships', blank=True, to='invoices.VatRate', null=True, on_delete=models.CASCADE),
),
migrations.AlterField(
model_name='conferenceadditionaloption',
migrations.AddField(
model_name='volunteerslot',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='volunteerassignment',
name='reg',
- field=models.ForeignKey(to='confreg.ConferenceRegistration'),
+ field=models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='volunteerassignment',
name='slot',
- field=models.ForeignKey(to='confreg.VolunteerSlot'),
+ field=models.ForeignKey(to='confreg.VolunteerSlot', on_delete=models.CASCADE),
),
migrations.RunSQL(
"CREATE INDEX confreg_volunteerslot_timerange_idx ON confreg_volunteerslot USING gist(timerange)",
('name', models.CharField(max_length=100)),
('url', models.URLField(blank=True)),
('content', models.BinaryField(null=True)),
- ('session', models.ForeignKey(to='confreg.ConferenceSession')),
+ ('session', models.ForeignKey(to='confreg.ConferenceSession', on_delete=models.CASCADE)),
],
),
]
name='ConferenceSeriesOptOut',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('series', models.ForeignKey(to='confreg.ConferenceSeries')),
+ ('series', models.ForeignKey(to='confreg.ConferenceSeries', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
name='GlobalOptOut',
fields=[
- ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
+ ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
),
migrations.AddField(
migrations.AddField(
model_name='conferenceseriesoptout',
name='user',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='conference',
name='series',
- field=models.ForeignKey(blank=True, to='confreg.ConferenceSeries', null=True),
+ field=models.ForeignKey(blank=True, to='confreg.ConferenceSeries', null=True, on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='conferenceseriesoptout',
migrations.AlterField(
model_name='conference',
name='series',
- field=models.ForeignKey(to='confreg.ConferenceSeries'),
+ field=models.ForeignKey(to='confreg.ConferenceSeries', on_delete=models.CASCADE),
),
]
migrations.AddField(
model_name='conferenceregistration',
name='registrator',
- field=models.ForeignKey(related_name='registrator', blank=True, null=True, to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(related_name='registrator', blank=True, null=True, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
preserve_default=False,
),
migrations.AlterField(
model_name='conferenceregistration',
name='attendee',
- field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True),
+ field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
),
migrations.RunSQL("UPDATE confreg_conferenceregistration SET registrator_id=attendee_id"),
migrations.AlterField(
model_name='conferenceregistration',
name='registrator',
- field=models.ForeignKey(related_name='registrator', to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(related_name='registrator', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
]
migrations.AddField(
model_name='aggregatedtshirtsizes',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='aggregatedtshirtsizes',
name='size',
- field=models.ForeignKey(to='confreg.ShirtSize'),
+ field=models.ForeignKey(to='confreg.ShirtSize', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='aggregateddietary',
name='conference',
- field=models.ForeignKey(to='confreg.Conference'),
+ field=models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='aggregatedtshirtsizes',
('token', models.CharField(max_length=200)),
('description', models.TextField()),
('permissions', postgresqleu.util.forms.ChoiceArrayField(base_field=models.CharField(max_length=32, choices=[(b'regtypes', b'Registration types and counters'), (b'discounts', b'Discount codes'), (b'vouchers', b'Voucher codes'), (b'sponsors', b'Sponsors and counts')]), size=None)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
),
migrations.AlterUniqueTogether(
class ConferenceSeriesOptOut(models.Model):
# Users opting out of communications about a specific conference
- series = models.ForeignKey(ConferenceSeries, null=False, blank=False)
- user = models.ForeignKey(User, null=False, blank=False)
+ series = models.ForeignKey(ConferenceSeries, null=False, blank=False, on_delete=models.CASCADE)
+ user = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
class Meta:
unique_together = (
class GlobalOptOut(models.Model):
# Users who are opting out of *all* future communications
- user = models.OneToOneField(User, null=False, blank=False, primary_key=True)
+ user = models.OneToOneField(User, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)
class Conference(models.Model):
lastmodified = models.DateTimeField(auto_now=True, null=False, blank=False)
newsjson = models.CharField(max_length=128, blank=True, null=True, default=None)
accounting_object = models.CharField(max_length=30, blank=True, null=True, verbose_name="Accounting object name")
- vat_registrations = models.ForeignKey(VatRate, null=True, blank=True, verbose_name='VAT rate for registrations', related_name='vat_registrations')
- vat_sponsorship = models.ForeignKey(VatRate, null=True, blank=True, verbose_name='VAT rate for sponsorships', related_name='vat_sponsorship')
+ vat_registrations = models.ForeignKey(VatRate, null=True, blank=True, verbose_name='VAT rate for registrations', related_name='vat_registrations', on_delete=models.CASCADE)
+ vat_sponsorship = models.ForeignKey(VatRate, null=True, blank=True, verbose_name='VAT rate for sponsorships', related_name='vat_sponsorship', on_delete=models.CASCADE)
invoice_autocancel_hours = models.IntegerField(blank=True, null=True, validators=[MinValueValidator(1),], verbose_name="Autocancel invoices", help_text="Automatically cancel invoices after this many hours")
attendees_before_waitlist = models.IntegerField(blank=False, null=False, default=0, validators=[MinValueValidator(0),], verbose_name="Attendees before waitlist", help_text="Maximum number of attendees before enabling waitlist management. 0 for no waitlist management")
- series = models.ForeignKey(ConferenceSeries, null=False, blank=False)
+ series = models.ForeignKey(ConferenceSeries, null=False, blank=False, on_delete=models.CASCADE)
personal_data_purged = models.DateTimeField(null=True, blank=True, help_text="Personal data for registrations for this conference have been purged")
# Attributes that are safe to access in jinja templates
return cc
class RegistrationClass(models.Model):
- conference = models.ForeignKey(Conference, null=False)
+ conference = models.ForeignKey(Conference, null=False, on_delete=models.CASCADE)
regclass = models.CharField(max_length=64, null=False, blank=False, verbose_name="Registration class")
badgecolor = models.CharField(max_length=20, null=False, blank=True, verbose_name="Badge color", help_text='Badge background color in hex format', validators=[color_validator, ])
badgeforegroundcolor = models.CharField(max_length=20, null=False, blank=True, verbose_name="Badge foreground", help_text='Badge foreground color in hex format', validators=[color_validator, ])
return d
class RegistrationDay(models.Model):
- conference = models.ForeignKey(Conference, null=False)
+ conference = models.ForeignKey(Conference, null=False, on_delete=models.CASCADE)
day = models.DateField(null=False, blank=False)
class Meta:
return df.format('D jS')
class RegistrationType(models.Model):
- conference = models.ForeignKey(Conference, null=False)
+ conference = models.ForeignKey(Conference, null=False, on_delete=models.CASCADE)
regtype = models.CharField(max_length=64, null=False, blank=False)
- regclass = models.ForeignKey(RegistrationClass, null=True, blank=True)
+ regclass = models.ForeignKey(RegistrationClass, null=True, blank=True, on_delete=models.CASCADE)
cost = models.DecimalField(decimal_places=2, max_digits=10, null=False, default=0, help_text="Cost excluding VAT.")
active = models.BooleanField(null=False, blank=False, default=True)
activeuntil = models.DateField(null=True, blank=True)
ordering = ('sortkey', 'shirtsize',)
class ConferenceAdditionalOption(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=False, blank=False)
cost = models.DecimalField(decimal_places=2, max_digits=10, null=False, default=0, help_text="Cost excluding VAT.")
maxcount = models.IntegerField(null=False)
class BulkPayment(models.Model):
# User that owns this bulk payment
- user = models.ForeignKey(User, null=False, blank=False)
+ user = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
# We attach it to a specific conference
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
# Invoice, once one has been created
- invoice = models.ForeignKey(Invoice, null=True, blank=True)
+ invoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
numregs = models.IntegerField(null=False, blank=False)
createdat = models.DateField(null=False, blank=False, auto_now_add=True)
self.paidat and 'Paid' or 'Not paid yet')
class ConferenceRegistration(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- regtype = models.ForeignKey(RegistrationType, null=True, blank=True, verbose_name="Registration type")
- attendee = models.ForeignKey(User, null=True, blank=True)
- registrator = models.ForeignKey(User, null=False, blank=False, related_name="registrator")
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ regtype = models.ForeignKey(RegistrationType, null=True, blank=True, verbose_name="Registration type", on_delete=models.CASCADE)
+ attendee = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE)
+ registrator = models.ForeignKey(User, null=False, blank=False, related_name="registrator", on_delete=models.CASCADE)
firstname = models.CharField(max_length=100, null=False, blank=False, verbose_name="First name")
lastname = models.CharField(max_length=100, null=False, blank=False, verbose_name="Last name")
email = models.EmailField(null=False, blank=False, verbose_name="E-mail address")
company = models.CharField(max_length=100, null=False, blank=True, verbose_name="Company")
address = models.TextField(max_length=200, null=False, blank=True, verbose_name="Address")
- country = models.ForeignKey(Country, null=False, blank=False, verbose_name="Country")
+ country = models.ForeignKey(Country, null=False, blank=False, verbose_name="Country", on_delete=models.CASCADE)
phone = models.CharField(max_length=100, null=False, blank=True, verbose_name="Phone number")
- shirtsize = models.ForeignKey(ShirtSize, null=True, blank=True, verbose_name="Preferred T-shirt size")
+ shirtsize = models.ForeignKey(ShirtSize, null=True, blank=True, verbose_name="Preferred T-shirt size", on_delete=models.CASCADE)
dietary = models.CharField(max_length=100, null=False, blank=True, verbose_name="Special dietary needs")
additionaloptions = models.ManyToManyField(ConferenceAdditionalOption, blank=True, verbose_name="Additional options")
twittername = models.CharField(max_length=100, null=False, blank=True, verbose_name="Twitter account", validators=[TwitterValidator, ])
# If an invoice is generated, link to it here so we can find our
# way back easily.
- invoice = models.ForeignKey(Invoice, null=True, blank=True)
- bulkpayment = models.ForeignKey(BulkPayment, null=True, blank=True)
+ invoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
+ bulkpayment = models.ForeignKey(BulkPayment, null=True, blank=True, on_delete=models.CASCADE)
# Any voucher codes. This is just used as temporary storage, and as
# such we don't try to make it a foreign key. Must be re-validated
return d
class RegistrationWaitlistEntry(models.Model):
- registration = models.OneToOneField(ConferenceRegistration, primary_key=True)
+ registration = models.OneToOneField(ConferenceRegistration, primary_key=True, on_delete=models.CASCADE)
enteredon = models.DateTimeField(null=False, blank=False, auto_now_add=True)
offeredon = models.DateTimeField(null=True, blank=True)
offerexpires = models.DateTimeField(null=True, blank=True)
return self.registrationwaitlisthistory_set.filter(text__startswith='Made offer').count()
class RegistrationWaitlistHistory(models.Model):
- waitlist = models.ForeignKey(RegistrationWaitlistEntry, null=False, blank=False)
+ waitlist = models.ForeignKey(RegistrationWaitlistEntry, null=False, blank=False, on_delete=models.CASCADE)
time = models.DateTimeField(null=False, blank=False, auto_now_add=True)
text = models.CharField(max_length=200, null=False, blank=False)
ordering = ('-time',)
class Track(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
trackname = models.CharField(max_length=100, null=False, blank=False)
color = models.CharField(max_length=20, null=False, blank=True, validators=[color_validator, ])
sortkey = models.IntegerField(null=False, default=100, blank=False)
return self.trackname
class Room(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
roomname = models.CharField(max_length=20, null=False, blank=False)
sortkey = models.IntegerField(null=False, blank=False, default=100)
return "%s" % instance.id
class Speaker(models.Model):
- user = models.OneToOneField(User, null=True, blank=True, unique=True)
+ user = models.OneToOneField(User, null=True, blank=True, unique=True, on_delete=models.CASCADE)
fullname = models.CharField(max_length=100, null=False, blank=False)
twittername = models.CharField(max_length=32, null=False, blank=True)
company = models.CharField(max_length=100, null=False, blank=True)
deltime = models.DateTimeField(blank=False, null=False)
class Speaker_Photo(models.Model):
- speaker = models.OneToOneField(Speaker, db_column='id', primary_key=True)
+ speaker = models.OneToOneField(Speaker, db_column='id', primary_key=True, on_delete=models.CASCADE)
photo = models.TextField(null=False, blank=False)
def __unicode__(self):
super(Speaker_Photo, self).delete()
class ConferenceSessionScheduleSlot(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
starttime = models.DateTimeField(null=False, blank=False)
endtime = models.DateTimeField(null=False, blank=False)
return "%s - %s" % (self.starttime, self.endtime)
class ConferenceSession(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
speaker = models.ManyToManyField(Speaker, blank=True)
title = models.CharField(max_length=200, null=False, blank=False)
starttime = models.DateTimeField(null=True, blank=True)
endtime = models.DateTimeField(null=True, blank=True)
- track = models.ForeignKey(Track, null=True, blank=True)
- room = models.ForeignKey(Room, null=True, blank=True)
+ track = models.ForeignKey(Track, null=True, blank=True, on_delete=models.CASCADE)
+ room = models.ForeignKey(Room, null=True, blank=True, on_delete=models.CASCADE)
cross_schedule = models.BooleanField(null=False, default=False)
can_feedback = models.BooleanField(null=False, default=True)
abstract = models.TextField(null=False, blank=True)
lastnotifiedtime = models.DateTimeField(null=True, blank=True, verbose_name="Notification last sent")
submissionnote = models.TextField(null=False, blank=True, verbose_name="Submission notes")
initialsubmit = models.DateTimeField(null=True, blank=True, verbose_name="Submitted")
- tentativescheduleslot = models.ForeignKey(ConferenceSessionScheduleSlot, null=True, blank=True)
- tentativeroom = models.ForeignKey(Room, null=True, blank=True, related_name='tentativeroom')
+ tentativescheduleslot = models.ForeignKey(ConferenceSessionScheduleSlot, null=True, blank=True, on_delete=models.CASCADE)
+ tentativeroom = models.ForeignKey(Room, null=True, blank=True, related_name='tentativeroom', on_delete=models.CASCADE)
lastmodified = models.DateTimeField(auto_now=True, null=False, blank=False)
# NOTE! Any added fields need to be considered for inclusion in
ordering = [ 'starttime', ]
class ConferenceSessionSlides(models.Model):
- session = models.ForeignKey(ConferenceSession, null=False, blank=False)
+ session = models.ForeignKey(ConferenceSession, null=False, blank=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=False, blank=False)
url = models.URLField(max_length=1000, null=False, blank=True)
content = models.BinaryField(null=True, blank=False)
_safe_attributes = ('id', 'name', 'url', 'content')
class ConferenceSessionVote(models.Model):
- session = models.ForeignKey(ConferenceSession, null=False, blank=False)
- voter = models.ForeignKey(User, null=False, blank=False)
+ session = models.ForeignKey(ConferenceSession, null=False, blank=False, on_delete=models.CASCADE)
+ voter = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
vote = models.IntegerField(null=True, blank=False)
comment = models.TextField(null=True, blank=True)
unique_together = ( ('session', 'voter',), )
class ConferenceSessionFeedback(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- session = models.ForeignKey(ConferenceSession, null=False, blank=False)
- attendee = models.ForeignKey(User, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ session = models.ForeignKey(ConferenceSession, null=False, blank=False, on_delete=models.CASCADE)
+ attendee = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
topic_importance = models.IntegerField(null=False, blank=False)
content_quality = models.IntegerField(null=False, blank=False)
speaker_knowledge = models.IntegerField(null=False, blank=False)
return unicode("%s - %s (%s)") % (self.conference, self.session, self.attendee)
class ConferenceFeedbackQuestion(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
question = models.CharField(max_length=100, null=False, blank=False)
isfreetext = models.BooleanField(blank=False, null=False, default=False)
textchoices = models.CharField(max_length=500, null=False, blank=True)
ordering = ['conference', 'sortkey', ]
class ConferenceFeedbackAnswer(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- question = models.ForeignKey(ConferenceFeedbackQuestion, null=False, blank=False)
- attendee = models.ForeignKey(User, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ question = models.ForeignKey(ConferenceFeedbackQuestion, null=False, blank=False, on_delete=models.CASCADE)
+ attendee = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
rateanswer = models.IntegerField(null=True)
textanswer = models.TextField(null=False, blank=True)
ordering = ['conference', 'attendee', 'question', ]
class VolunteerSlot(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
timerange = DateTimeRangeField(null=False, blank=False)
title = models.CharField(max_length=50, null=False, blank=False)
min_staff = models.IntegerField(null=False, blank=False, default=1, validators=[MinValueValidator(1)])
return self._localtz.localize(time).astimezone(pytz.utc)
class VolunteerAssignment(models.Model):
- slot = models.ForeignKey(VolunteerSlot, null=False, blank=False)
- reg = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ slot = models.ForeignKey(VolunteerSlot, null=False, blank=False, on_delete=models.CASCADE)
+ reg = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
vol_confirmed = models.BooleanField(null=False, blank=False, default=False, verbose_name="Confirmed by volunteer")
org_confirmed = models.BooleanField(null=False, blank=False, default=False, verbose_name="Confirmed by organizers")
_safe_attributes = ('id', 'slot', 'reg', 'vol_confirmed', 'org_confirmed')
class PrepaidBatch(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- regtype = models.ForeignKey(RegistrationType, null=False, blank=False)
- buyer = models.ForeignKey(User, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ regtype = models.ForeignKey(RegistrationType, null=False, blank=False, on_delete=models.CASCADE)
+ buyer = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
buyername = models.CharField(max_length=100, null=True, blank=True)
- sponsor = models.ForeignKey('confsponsor.Sponsor', null=True, blank=True, verbose_name="Optional sponsor")
+ sponsor = models.ForeignKey('confsponsor.Sponsor', null=True, blank=True, verbose_name="Optional sponsor", on_delete=models.CASCADE)
def __unicode__(self):
return "%s: %s for %s" % (self.conference, self.regtype, self.buyer)
ordering = ['conference', 'id', ]
class PrepaidVoucher(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
vouchervalue = models.CharField(max_length=100, null=False, blank=False, unique=True)
- batch = models.ForeignKey(PrepaidBatch, null=False, blank=False)
- user = models.ForeignKey(ConferenceRegistration, null=True, blank=True)
+ batch = models.ForeignKey(PrepaidBatch, null=False, blank=False, on_delete=models.CASCADE)
+ user = models.ForeignKey(ConferenceRegistration, null=True, blank=True, on_delete=models.CASCADE)
usedate = models.DateTimeField(null=True, blank=True)
def __unicode__(self):
ordering = ['batch', 'vouchervalue', ]
class DiscountCode(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
code = models.CharField(max_length=100, null=False, blank=False)
discountamount = models.DecimalField(decimal_places=2, max_digits=10, null=False, default=0)
discountpercentage = models.IntegerField(null=False, blank=False, default=0)
registrations = models.ManyToManyField(ConferenceRegistration, blank=True)
# If this discount code is purchased by a sponsor, track it here.
- sponsor = models.ForeignKey('confsponsor.Sponsor', null=True, blank=True, verbose_name="Optional sponsor.", help_text="Note that if a sponsor is picked, an invoice will be generated once the discount code closes!!!")
- sponsor_rep = models.ForeignKey(User, null=True, blank=True, verbose_name="Optional sponsor representative.", help_text="Must be set if the sponsor field is set!")
+ sponsor = models.ForeignKey('confsponsor.Sponsor', null=True, blank=True, verbose_name="Optional sponsor.", help_text="Note that if a sponsor is picked, an invoice will be generated once the discount code closes!!!", on_delete=models.CASCADE)
+ sponsor_rep = models.ForeignKey(User, null=True, blank=True, verbose_name="Optional sponsor representative.", help_text="Must be set if the sponsor field is set!", on_delete=models.CASCADE)
is_invoiced = models.BooleanField(null=False, blank=False, default=False, verbose_name="Has an invoice been sent for this discount code.")
def __unicode__(self):
return self.registrations.count()
class AttendeeMail(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
regclasses = models.ManyToManyField(RegistrationClass, blank=False)
sentat = models.DateTimeField(null=False, blank=False, auto_now_add=True)
subject = models.CharField(max_length=100, null=False, blank=False)
class PendingAdditionalOrder(models.Model):
- reg = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ reg = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
options = models.ManyToManyField(ConferenceAdditionalOption, blank=False)
- newregtype = models.ForeignKey(RegistrationType, null=True, blank=True)
+ newregtype = models.ForeignKey(RegistrationType, null=True, blank=True, on_delete=models.CASCADE)
createtime = models.DateTimeField(null=False, blank=False)
- invoice = models.ForeignKey(Invoice, null=True, blank=True)
+ invoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
payconfirmedat = models.DateTimeField(null=True, blank=True)
def __unicode__(self):
class AggregatedTshirtSizes(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- size = models.ForeignKey(ShirtSize, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ size = models.ForeignKey(ShirtSize, null=False, blank=False, on_delete=models.CASCADE)
num = models.IntegerField(null=False, blank=False)
class Meta:
unique_together = ( ('conference', 'size'), )
class AggregatedDietary(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
dietary = models.CharField(max_length=100, null=False, blank=False)
num = models.IntegerField(null=False, blank=False)
)
class AccessToken(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
token = models.CharField(max_length=200, null=False, blank=False)
description = models.TextField(null=False, blank=False)
permissions = ChoiceArrayField(
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('num', models.IntegerField()),
- ('batch', models.ForeignKey(blank=True, to='confreg.PrepaidBatch', null=True)),
- ('invoice', models.ForeignKey(to='invoices.Invoice')),
- ('regtype', models.ForeignKey(to='confreg.RegistrationType')),
+ ('batch', models.ForeignKey(blank=True, to='confreg.PrepaidBatch', null=True, on_delete=models.CASCADE)),
+ ('invoice', models.ForeignKey(to='invoices.Invoice', on_delete=models.CASCADE)),
+ ('regtype', models.ForeignKey(to='confreg.RegistrationType', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('confirmed', models.BooleanField(default=False)),
('confirmedat', models.DateTimeField(null=True, blank=True)),
('confirmedby', models.CharField(max_length=50, blank=True)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
- ('invoice', models.ForeignKey(blank=True, to='invoices.Invoice', null=True)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
+ ('invoice', models.ForeignKey(blank=True, to='invoices.Invoice', null=True, on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('sentat', models.DateTimeField(auto_now_add=True)),
('subject', models.CharField(max_length=100)),
('message', models.TextField(max_length=8000)),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
],
options={
'ordering': ('-sentat',),
('instantbuy', models.BooleanField(default=False, verbose_name="Instant buy available")),
('canbuyvoucher', models.BooleanField(default=True, verbose_name="Can buy vouchers")),
('canbuydiscountcode', models.BooleanField(default=True, verbose_name="Can buy discount codes")),
- ('conference', models.ForeignKey(to='confreg.Conference')),
- ('contract', models.ForeignKey(blank=True, to='confsponsor.SponsorshipContract', null=True)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
+ ('contract', models.ForeignKey(blank=True, to='confsponsor.SponsorshipContract', null=True, on_delete=models.CASCADE)),
('paymentmethods', models.ManyToManyField(to='invoices.InvoicePaymentMethod', verbose_name=b'Payment methods for generated invoices')),
],
options={
migrations.AddField(
model_name='sponsorshipbenefit',
name='level',
- field=models.ForeignKey(to='confsponsor.SponsorshipLevel'),
+ field=models.ForeignKey(to='confsponsor.SponsorshipLevel', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='sponsormail',
migrations.AddField(
model_name='sponsorclaimedbenefit',
name='benefit',
- field=models.ForeignKey(to='confsponsor.SponsorshipBenefit'),
+ field=models.ForeignKey(to='confsponsor.SponsorshipBenefit', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='sponsorclaimedbenefit',
name='claimedby',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='sponsorclaimedbenefit',
name='sponsor',
- field=models.ForeignKey(to='confsponsor.Sponsor'),
+ field=models.ForeignKey(to='confsponsor.Sponsor', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='sponsor',
name='level',
- field=models.ForeignKey(to='confsponsor.SponsorshipLevel'),
+ field=models.ForeignKey(to='confsponsor.SponsorshipLevel', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='sponsor',
migrations.AddField(
model_name='purchasedvoucher',
name='sponsor',
- field=models.ForeignKey(to='confsponsor.Sponsor'),
+ field=models.ForeignKey(to='confsponsor.Sponsor', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='purchasedvoucher',
name='user',
- field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
+ field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='sponsorshiplevel',
migrations.AddField(
model_name='sponsorshipcontract',
name='conference',
- field=models.ForeignKey(to='confreg.Conference', null=True),
+ field=models.ForeignKey(to='confreg.Conference', null=True, on_delete=models.CASCADE),
),
migrations.RunSQL("UPDATE confsponsor_sponsorshipcontract c SET conference_id=(SELECT conference_id FROM confsponsor_sponsorshiplevel l WHERE l.contract_id=c.id LIMIT 1)"),
migrations.AlterField(
model_name='sponsorshipcontract',
name='conference',
- field=models.ForeignKey(to='confreg.Conference', null=False),
+ field=models.ForeignKey(to='confreg.Conference', null=False, on_delete=models.CASCADE),
),
]
)
class SponsorshipContract(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
contractname = models.CharField(max_length=100, null=False, blank=False, verbose_name='Contract name')
contractpdf = FileField(null=False, blank=True, storage=InlineEncodedStorage('sponsorcontract'), upload_to=inlineencoded_upload_path, verbose_name='Contract PDF')
pre_delete.connect(delete_inline_storage, sender=SponsorshipContract)
class SponsorshipLevel(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
levelname = models.CharField(max_length=100, null=False, blank=False)
urlname = models.CharField(max_length=100, null=False, blank=False, validators=[validate_lowercase,])
levelcost = models.IntegerField(null=False, blank=False)
available = models.BooleanField(null=False, blank=False, default=True, verbose_name="Available for signup")
instantbuy = models.BooleanField(null=False, blank=False, default=False, verbose_name="Instant buy available")
paymentmethods = models.ManyToManyField(InvoicePaymentMethod, blank=False, verbose_name="Payment methods for generated invoices")
- contract = models.ForeignKey(SponsorshipContract, blank=True, null=True)
+ contract = models.ForeignKey(SponsorshipContract, blank=True, null=True, on_delete=models.CASCADE)
canbuyvoucher = models.BooleanField(null=False, blank=False, default=True, verbose_name="Can buy vouchers")
canbuydiscountcode = models.BooleanField(null=False, blank=False, default=True, verbose_name="Can buy discount codes")
unique_together = (('conference', 'urlname'), )
class SponsorshipBenefit(models.Model):
- level = models.ForeignKey(SponsorshipLevel, null=False, blank=False)
+ level = models.ForeignKey(SponsorshipLevel, null=False, blank=False, on_delete=models.CASCADE)
benefitname = models.CharField(max_length=100, null=False, blank=False)
sortkey = models.PositiveIntegerField(null=False, blank=False, default=100)
benefitdescription = models.TextField(null=False, blank=True)
ordering = ('sortkey', 'benefitname', )
class Sponsor(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=False, blank=False)
displayname = models.CharField(max_length=100, null=False, blank=False)
invoiceaddr = models.TextField(max_length=500, null=False, blank=True)
managers = models.ManyToManyField(User, blank=False)
url = models.URLField(max_length=200, null=False, blank=True)
twittername = models.CharField(max_length=100, null=False, blank=True)
- level = models.ForeignKey(SponsorshipLevel, null=False, blank=False)
- invoice = models.ForeignKey(Invoice, null=True, blank=True)
+ level = models.ForeignKey(SponsorshipLevel, null=False, blank=False, on_delete=models.CASCADE)
+ invoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
confirmed = models.BooleanField(null=False, blank=False, default=False)
confirmedat = models.DateTimeField(null=True, blank=True)
confirmedby = models.CharField(max_length=50, null=False, blank=True)
return self.name
class SponsorClaimedBenefit(models.Model):
- sponsor = models.ForeignKey(Sponsor, null=False, blank=False)
- benefit = models.ForeignKey(SponsorshipBenefit, null=False, blank=False)
+ sponsor = models.ForeignKey(Sponsor, null=False, blank=False, on_delete=models.CASCADE)
+ benefit = models.ForeignKey(SponsorshipBenefit, null=False, blank=False, on_delete=models.CASCADE)
claimedat = models.DateTimeField(null=False, blank=False)
- claimedby = models.ForeignKey(User, null=False, blank=False)
+ claimedby = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
declined = models.BooleanField(null=False, blank=False, default=False)
claimdata = models.TextField(max_length=500, blank=True, null=False)
confirmed = models.BooleanField(null=False, blank=False, default=False)
unique_together = (('sponsor', 'benefit'),)
class SponsorMail(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
levels = models.ManyToManyField(SponsorshipLevel, blank=False)
sentat = models.DateTimeField(null=False, blank=False, auto_now_add=True)
subject = models.CharField(max_length=100, null=False, blank=False)
ordering = ('-sentat',)
class PurchasedVoucher(models.Model):
- sponsor = models.ForeignKey(Sponsor, null=False, blank=False)
- user = models.ForeignKey(User, null=False, blank=False)
- regtype = models.ForeignKey(RegistrationType, null=False, blank=False)
+ sponsor = models.ForeignKey(Sponsor, null=False, blank=False, on_delete=models.CASCADE)
+ user = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
+ regtype = models.ForeignKey(RegistrationType, null=False, blank=False, on_delete=models.CASCADE)
num = models.IntegerField(null=False, blank=False)
- invoice = models.ForeignKey(Invoice, null=False, blank=False)
- batch = models.ForeignKey(PrepaidBatch, null=True, blank=True)
+ invoice = models.ForeignKey(Invoice, null=False, blank=False, on_delete=models.CASCADE)
+ batch = models.ForeignKey(PrepaidBatch, null=True, blank=True, on_delete=models.CASCADE)
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('choice', models.CharField(max_length=100, blank=True)),
('saved', models.DateTimeField(auto_now=True)),
- ('attendee', models.ForeignKey(to='confreg.ConferenceRegistration')),
+ ('attendee', models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('public', models.BooleanField(default=False, help_text=b'All attendees can sign up')),
('visible', models.BooleanField(default=False, help_text=b'Show who have signed up to all invited attendees')),
('attendees', models.ManyToManyField(related_name='user_attendees', verbose_name=b'Available to attendees', to='confreg.ConferenceRegistration', blank=True)),
- ('author', models.ForeignKey(to='confreg.ConferenceRegistration')),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('author', models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
('regtypes', models.ManyToManyField(related_name='user_regtypes', verbose_name=b'Available to registration types', to='confreg.RegistrationType', blank=True)),
],
options={
('publicview', models.BooleanField(default=False, help_text=b'Can all confirmed attendees see this page?', verbose_name=b'Public view')),
('publicedit', models.BooleanField(default=False, help_text=b'Can all confirmed attendees edit this page?', verbose_name=b'Public edit')),
('history', models.BooleanField(default=True, help_text=b'Can users view the history?')),
- ('author', models.ForeignKey(to='confreg.ConferenceRegistration')),
- ('conference', models.ForeignKey(to='confreg.Conference')),
+ ('author', models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
+ ('conference', models.ForeignKey(to='confreg.Conference', on_delete=models.CASCADE)),
('editor_attendee', models.ManyToManyField(related_name='editor_attendees', verbose_name=b'Editor attendees', to='confreg.ConferenceRegistration', blank=True)),
('editor_regtype', models.ManyToManyField(related_name='editor_regtypes', verbose_name=b'Editor registration types', to='confreg.RegistrationType', blank=True)),
('viewer_attendee', models.ManyToManyField(related_name='viewer_attendees', verbose_name=b'Viewer attendees', to='confreg.ConferenceRegistration', blank=True)),
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('publishedat', models.DateTimeField()),
('contents', models.TextField()),
- ('author', models.ForeignKey(to='confreg.ConferenceRegistration')),
- ('page', models.ForeignKey(to='confwiki.Wikipage')),
+ ('author', models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
+ ('page', models.ForeignKey(to='confwiki.Wikipage', on_delete=models.CASCADE)),
],
options={
'ordering': ('-publishedat',),
name='WikipageSubscriber',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
- ('page', models.ForeignKey(to='confwiki.Wikipage')),
- ('subscriber', models.ForeignKey(to='confreg.ConferenceRegistration')),
+ ('page', models.ForeignKey(to='confwiki.Wikipage', on_delete=models.CASCADE)),
+ ('subscriber', models.ForeignKey(to='confreg.ConferenceRegistration', on_delete=models.CASCADE)),
],
),
migrations.AddField(
model_name='attendeesignup',
name='signup',
- field=models.ForeignKey(to='confwiki.Signup'),
+ field=models.ForeignKey(to='confwiki.Signup', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='wikipagehistory',
from postgresqleu.util.diffablemodel import DiffableModel
class Wikipage(models.Model, DiffableModel):
- conference = models.ForeignKey(Conference, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
url = models.CharField(max_length=100, null=False, blank=False, validators=[
RegexValidator(regex='^[a-zA-Z0-9_-]+$',
message='Invalid character in urlname. Only alphanumerical, underscore and dash are allowed.'),])
title = models.CharField(max_length=100, null=False, blank=False)
- author = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ author = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
publishedat = models.DateTimeField(null=False, blank=False, auto_now=True)
contents = models.TextField(null=False, blank=False)
# When a page is edited, the old version is copied over to the history. A page that has
# never been edited has no history entry. Permission changes are not tracked.
class WikipageHistory(models.Model):
- page = models.ForeignKey(Wikipage, null=False, blank=False, db_index=True)
- author = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ page = models.ForeignKey(Wikipage, null=False, blank=False, db_index=True, on_delete=models.CASCADE)
+ author = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
publishedat = models.DateTimeField(null=False, blank=False)
contents = models.TextField(null=False, blank=False)
# Subscribers to changes of wikipages
class WikipageSubscriber(models.Model):
- page = models.ForeignKey(Wikipage, null=False, blank=False, db_index=True)
- subscriber = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ page = models.ForeignKey(Wikipage, null=False, blank=False, db_index=True, on_delete=models.CASCADE)
+ subscriber = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
def validate_options(value):
# Signups - attendees can sign up for events
class Signup(models.Model):
- conference = models.ForeignKey(Conference, null=False, blank=False)
- author = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ conference = models.ForeignKey(Conference, null=False, blank=False, on_delete=models.CASCADE)
+ author = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
title = models.CharField(max_length=100, null=False, blank=False)
intro = models.TextField(null=False, blank=False)
deadline = models.DateTimeField(null=True, blank=True)
raise ValidationError({"optionvalues": "Cannot specify optionvalues if options are not specified!"})
class AttendeeSignup(models.Model):
- signup = models.ForeignKey(Signup, null=False, blank=False)
- attendee = models.ForeignKey(ConferenceRegistration, null=False, blank=False)
+ signup = models.ForeignKey(Signup, null=False, blank=False, on_delete=models.CASCADE)
+ attendee = models.ForeignKey(ConferenceRegistration, null=False, blank=False, on_delete=models.CASCADE)
choice = models.CharField(max_length=100, null=False, blank=True)
saved = models.DateTimeField(null=False, blank=False, auto_now=True)
migrations.CreateModel(
name='EuropeCountry',
fields=[
- ('iso', models.OneToOneField(primary_key=True, serialize=False, to='countries.Country')),
+ ('iso', models.OneToOneField(primary_key=True, serialize=False, to='countries.Country', on_delete=models.CASCADE)),
],
),
]
\r
# XXX: this table is added by pgeu :)\r
class EuropeCountry(models.Model):\r
- iso = models.OneToOneField(Country, null=False, blank=False, primary_key=True)\r
+ iso = models.OneToOneField(Country, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)\r
\r
def __unicode__(self):\r
return iso.name\r
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('score', models.IntegerField()),
- ('candidate', models.ForeignKey(to='elections.Candidate')),
- ('election', models.ForeignKey(to='elections.Election')),
+ ('candidate', models.ForeignKey(to='elections.Candidate', on_delete=models.CASCADE)),
+ ('election', models.ForeignKey(to='elections.Election', on_delete=models.CASCADE)),
],
),
]
migrations.AddField(
model_name='vote',
name='voter',
- field=models.ForeignKey(to='membership.Member'),
+ field=models.ForeignKey(to='membership.Member', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='candidate',
name='election',
- field=models.ForeignKey(to='elections.Election'),
+ field=models.ForeignKey(to='elections.Election', on_delete=models.CASCADE),
),
]
return self.name
class Candidate(models.Model):
- election = models.ForeignKey(Election, null=False, blank=False)
+ election = models.ForeignKey(Election, null=False, blank=False, on_delete=models.CASCADE)
name = models.CharField(max_length=100, null=False, blank=False)
email = models.EmailField(max_length=200, null=False, blank=False)
presentation = models.TextField(null=False, blank=False)
return "%s (%s)" % (self.name, self.election)
class Vote(models.Model):
- election = models.ForeignKey(Election, null=False, blank=False)
- voter = models.ForeignKey(Member, null=False, blank=False)
- candidate = models.ForeignKey(Candidate, null=False, blank=False)
+ election = models.ForeignKey(Election, null=False, blank=False, on_delete=models.CASCADE)
+ voter = models.ForeignKey(Member, null=False, blank=False, on_delete=models.CASCADE)
+ candidate = models.ForeignKey(Candidate, null=False, blank=False, on_delete=models.CASCADE)
score = models.IntegerField(null=False, blank=False)
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('time', models.DateTimeField(auto_now_add=True)),
('txt', models.CharField(max_length=100)),
- ('invoice', models.ForeignKey(to='invoices.Invoice')),
+ ('invoice', models.ForeignKey(to='invoices.Invoice', on_delete=models.CASCADE)),
],
options={
'ordering': ['time'],
('rowtext', models.CharField(max_length=100, verbose_name=b'Text')),
('rowcount', models.IntegerField(default=1, verbose_name=b'Count')),
('rowamount', models.IntegerField(default=0, verbose_name=b'Amount per item')),
- ('invoice', models.ForeignKey(to='invoices.Invoice')),
+ ('invoice', models.ForeignKey(to='invoices.Invoice', on_delete=models.CASCADE)),
],
),
migrations.AddField(
migrations.AddField(
model_name='invoice',
name='processor',
- field=models.ForeignKey(blank=True, to='invoices.InvoiceProcessor', null=True),
+ field=models.ForeignKey(blank=True, to='invoices.InvoiceProcessor', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='invoice',
name='recipient_user',
- field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True),
+ field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
),
]
migrations.AddField(
model_name='invoice',
name='paidusing',
- field=models.ForeignKey(related_name='paidusing', verbose_name=b'Payment method actually used', to='invoices.InvoicePaymentMethod', null=True),
+ field=models.ForeignKey(related_name='paidusing', verbose_name=b'Payment method actually used', to='invoices.InvoicePaymentMethod', null=True, on_delete=models.CASCADE),
),
migrations.RunSQL("UPDATE invoices_invoice SET paidusing_id=(SELECT id FROM invoices_invoicepaymentmethod WHERE classname='postgresqleu.util.payment.adyen.AdyenCreditcard') WHERE EXISTS (SELECT 1 FROM adyen_transactionstatus WHERE notes='PGEU' || invoices_invoice.id AND method != 'bankTransfer_IBAN')"),
migrations.RunSQL("UPDATE invoices_invoice SET paidusing_id=(SELECT id FROM invoices_invoicepaymentmethod WHERE classname='postgresqleu.util.payment.adyen.AdyenBanktransfer') WHERE EXISTS (SELECT 1 FROM adyen_transactionstatus WHERE notes='PGEU' || invoices_invoice.id AND method = 'bankTransfer_IBAN')"),
migrations.AlterField(
model_name='invoice',
name='paidusing',
- field=models.ForeignKey(related_name='paidusing', verbose_name=b'Payment method actually used', blank=True, to='invoices.InvoicePaymentMethod', null=True),
+ field=models.ForeignKey(related_name='paidusing', verbose_name=b'Payment method actually used', blank=True, to='invoices.InvoicePaymentMethod', null=True, on_delete=models.CASCADE),
),
]
('name', models.CharField(max_length=100)),
('shortname', models.CharField(max_length=16)),
('vatpercent', models.IntegerField(default=0, verbose_name=b'VAT percentage', validators=[django.core.validators.MaxValueValidator(100), django.core.validators.MinValueValidator(0)])),
- ('vataccount', models.ForeignKey(to='accounting.Account')),
+ ('vataccount', models.ForeignKey(to='accounting.Account', on_delete=models.CASCADE)),
],
),
migrations.AddField(
migrations.AddField(
model_name='invoicerow',
name='vatrate',
- field=models.ForeignKey(to='invoices.VatRate', null=True),
+ field=models.ForeignKey(to='invoices.VatRate', null=True, on_delete=models.CASCADE),
),
]
migrations.AddField(
model_name='invoicerefund',
name='vatrate',
- field=models.ForeignKey(to='invoices.VatRate', null=True),
+ field=models.ForeignKey(to='invoices.VatRate', null=True, on_delete=models.CASCADE),
),
migrations.AlterField(
model_name='invoicerefund',
amount = models.DecimalField(max_digits=10, decimal_places=2, null=False)
vatamount = models.DecimalField(max_digits=10, decimal_places=2, null=False)
- vatrate = models.ForeignKey('VatRate', null=True)
+ vatrate = models.ForeignKey('VatRate', null=True, on_delete=models.CASCADE)
registered = models.DateTimeField(null=False, auto_now_add=True)
issued = models.DateTimeField(null=True, blank=True)
# by name. If email is set, we can retro-match it up, but once
# a recipient is matched, the recipient_user field "owns" the
# recipient information.
- recipient_user = models.ForeignKey(User, null=True, blank=True)
+ recipient_user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE)
recipient_email = models.EmailField(blank=True, null=False)
recipient_name = models.CharField(max_length=100, blank=False, null=False)
recipient_address = models.TextField(blank=False, null=False)
# of this invoice. This can typically be to flag a conference
# payment as done once the payment is in. processorid is an arbitrary
# id value that the processor can use for whatever it wants.
- processor = models.ForeignKey(InvoiceProcessor, null=True, blank=True)
+ processor = models.ForeignKey(InvoiceProcessor, null=True, blank=True, on_delete=models.CASCADE)
processorid = models.IntegerField(null=True, blank=True)
# Allowed payment methods
# writes the details of the transaction to the paymentdetails field.
paidat = models.DateTimeField(null=True, blank=True)
paymentdetails = models.CharField(max_length=100, null=False, blank=True)
- paidusing = models.ForeignKey(InvoicePaymentMethod, null=True, blank=True, related_name="paidusing", verbose_name="Payment method actually used")
+ paidusing = models.ForeignKey(InvoicePaymentMethod, null=True, blank=True, related_name="paidusing", verbose_name="Payment method actually used", on_delete=models.CASCADE)
# Reminder (if any) sent when?
remindersent = models.DateTimeField(null=True, blank=True, verbose_name="Automatic reminder sent at")
shortname = models.CharField(max_length=16, blank=False, null=False)
vatpercent = models.IntegerField(null=False, default=0, verbose_name="VAT percentage",
validators=[MaxValueValidator(100), MinValueValidator(0)])
- vataccount = models.ForeignKey(Account, null=False, blank=False)
+ vataccount = models.ForeignKey(Account, null=False, blank=False, on_delete=models.CASCADE)
_safe_attributes = ('vatpercent', 'shortstr', 'shortname', 'name', 'org_name', 'treasurer_email')
class InvoiceRow(models.Model):
# Invoice rows are only used up until the invoice is finished,
# but allows us to save a half-finished invoice.
- invoice = models.ForeignKey(Invoice, null=False)
+ invoice = models.ForeignKey(Invoice, null=False, on_delete=models.CASCADE)
rowtext = models.CharField(max_length=100, blank=False, null=False, verbose_name="Text")
rowcount = models.IntegerField(null=False, default=1, verbose_name="Count")
rowamount = models.DecimalField(decimal_places=2, max_digits=10, null=False, default=0, verbose_name="Amount per item (ex VAT)")
- vatrate = models.ForeignKey(VatRate, null=True)
+ vatrate = models.ForeignKey(VatRate, null=True, on_delete=models.CASCADE)
def __unicode__(self):
return self.rowtext
return self.totalrow + self.totalvat
class InvoiceHistory(models.Model):
- invoice = models.ForeignKey(Invoice, null=False)
+ invoice = models.ForeignKey(Invoice, null=False, on_delete=models.CASCADE)
time = models.DateTimeField(null=False, blank=False, auto_now_add=True)
txt = models.CharField(max_length=100, null=False, blank=False)
migrations.CreateModel(
name='Member',
fields=[
- ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
+ ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('fullname', models.CharField(max_length=500, verbose_name=b'Full name')),
('listed', models.BooleanField(default=True, verbose_name=b'Listed in the public membership list')),
('paiduntil', models.DateField(null=True, blank=True)),
('membersince', models.DateField(null=True, blank=True)),
('expiry_warning_sent', models.DateTimeField(null=True, blank=True)),
- ('activeinvoice', models.ForeignKey(blank=True, to='invoices.Invoice', null=True)),
- ('country', models.ForeignKey(to='countries.Country')),
+ ('activeinvoice', models.ForeignKey(blank=True, to='invoices.Invoice', null=True, on_delete=models.CASCADE)),
+ ('country', models.ForeignKey(to='countries.Country', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('timestamp', models.DateTimeField()),
('message', models.TextField()),
- ('member', models.ForeignKey(to='membership.Member')),
+ ('member', models.ForeignKey(to='membership.Member', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('key', models.CharField(max_length=100)),
- ('meeting', models.ForeignKey(to='membership.Meeting')),
- ('member', models.ForeignKey(to='membership.Member')),
+ ('meeting', models.ForeignKey(to='membership.Meeting', on_delete=models.CASCADE)),
+ ('member', models.ForeignKey(to='membership.Member', on_delete=models.CASCADE)),
],
),
migrations.AddField(
from datetime import date, datetime, timedelta
class Member(models.Model):
- user = models.OneToOneField(User, null=False, blank=False, primary_key=True)
+ user = models.OneToOneField(User, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)
fullname = models.CharField(max_length=500, null=False, blank=False,
verbose_name='Full name')
- country = models.ForeignKey(Country, null=False, blank=False)
+ country = models.ForeignKey(Country, null=False, blank=False, on_delete=models.CASCADE)
listed = models.BooleanField(null=False, blank=False, default=True,
verbose_name='Listed in the public membership list')
paiduntil = models.DateField(null=True, blank=True)
# If there is a currently active invoice, link to it here so we can
# easily render the information on the page.
- activeinvoice = models.ForeignKey(Invoice, null=True, blank=True)
+ activeinvoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
# When a membeship expiry warning was last sent, so we don't keep
# sending them over and over again
return "%s (%s)" % (self.fullname, self.user.username)
class MemberLog(models.Model):
- member = models.ForeignKey(Member, null=False, blank=False)
+ member = models.ForeignKey(Member, null=False, blank=False, on_delete=models.CASCADE)
timestamp = models.DateTimeField(null=False)
message = models.TextField(null=False, blank=False)
class MemberMeetingKey(models.Model):
- member = models.ForeignKey(Member, null=False, blank=False)
- meeting = models.ForeignKey(Meeting, null=False, blank=False)
+ member = models.ForeignKey(Member, null=False, blank=False, on_delete=models.CASCADE)
+ meeting = models.ForeignKey(Meeting, null=False, blank=False, on_delete=models.CASCADE)
key = models.CharField(max_length=100, null=False, blank=False)
proxyname = models.CharField(max_length=200, null=True, blank=False)
proxyaccesskey = models.CharField(max_length=100, null=True, blank=False)
('city', models.CharField(max_length=128)),
('state', models.CharField(max_length=8, blank=True)),
('summary', models.TextField()),
- ('country', models.ForeignKey(to='countries.Country')),
+ ('country', models.ForeignKey(to='countries.Country', on_delete=models.CASCADE)),
],
options={
'ordering': ['startdate', 'title'],
('transtext', models.CharField(max_length=1000)),
('matched', models.BooleanField()),
('matchinfo', models.CharField(max_length=1000, null=True, blank=True)),
- ('sourceaccount', models.ForeignKey(to='paypal.SourceAccount')),
+ ('sourceaccount', models.ForeignKey(to='paypal.SourceAccount', on_delete=models.CASCADE)),
],
),
]
class TransactionInfo(models.Model):
paypaltransid = models.CharField(max_length=20, null=False, blank=False, unique=True)
timestamp = models.DateTimeField(null=False, blank=False)
- sourceaccount = models.ForeignKey(SourceAccount, null=False, blank=False)
+ sourceaccount = models.ForeignKey(SourceAccount, null=False, blank=False, on_delete=models.CASCADE)
sender = models.CharField(max_length=200, null=False, blank=False)
sendername = models.CharField(max_length=200, null=False, blank=False)
amount = models.DecimalField(decimal_places=2, max_digits=10, null=False, blank=False)
migrations.AddField(
model_name='trustlynotification',
name='rawnotification',
- field=models.ForeignKey(blank=True, to='trustlypayment.TrustlyRawNotification', null=True),
+ field=models.ForeignKey(blank=True, to='trustlypayment.TrustlyRawNotification', null=True, on_delete=models.CASCADE),
),
]
class TrustlyNotification(models.Model):
receivedat = models.DateTimeField(null=False, blank=False, auto_now_add=True, unique=True)
- rawnotification = models.ForeignKey(TrustlyRawNotification, null=True, blank=True)
+ rawnotification = models.ForeignKey(TrustlyRawNotification, null=True, blank=True, on_delete=models.CASCADE)
notificationid = models.BigIntegerField(null=False, blank=False)
orderid = models.BigIntegerField(null=False, blank=False)
method = models.CharField(max_length=80, null=False, blank=False)