Browse Source

Switch some fields to `Membership`.

feature/python-error-tracking
Drew Larson 9 years ago
parent
commit
d111c0c515
  1. 30
      bikeshop_project/core/migrations/0004_auto_20160410_1816.py
  2. 7
      bikeshop_project/core/models.py
  3. 32
      bikeshop_project/registration/migrations/0004_auto_20160410_1816.py
  4. 5
      bikeshop_project/registration/models.py

30
bikeshop_project/core/migrations/0004_auto_20160410_1816.py

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-10 18:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_visit'),
]
operations = [
migrations.AddField(
model_name='membership',
name='gender',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='membership',
name='involvement',
field=models.CharField(blank=True, max_length=255, null=True),
),
migrations.AddField(
model_name='membership',
name='self_identification',
field=models.CharField(blank=True, max_length=255, null=True),
),
]

7
bikeshop_project/core/models.py

@ -17,6 +17,9 @@ class Membership(models.Model):
give_back = models.BooleanField(default=False) give_back = models.BooleanField(default=False)
# this should be a form field that requires the new member to type out there full name # this should be a form field that requires the new member to type out there full name
acknowledgement = models.BooleanField(default=False) acknowledgement = models.BooleanField(default=False)
self_identification = models.CharField(max_length=255, null=True, blank=True)
gender = models.CharField(max_length=255, null=True, blank=True)
involvement = models.CharField(max_length=255, null=True, blank=True)
class Payment(models.Model): class Payment(models.Model):
@ -38,8 +41,10 @@ class Payment(models.Model):
class Visit(models.Model): class Visit(models.Model):
visit_choices = ( visit_choices = (
('VOLUNTEER', 'volunteer'), ('VOLUNTEER', 'volunteer'),
('WORK', 'work on bike'), ('WORK', 'work on bike'), # fix
('WORKSHOP', 'workshop') ('WORKSHOP', 'workshop')
# Visit
# Donation
) )
member = models.ForeignKey( member = models.ForeignKey(
'registration.Member', 'registration.Member',

32
bikeshop_project/registration/migrations/0004_auto_20160410_1816.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-10 18:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0003_auto_20160327_0620'),
]
operations = [
migrations.RemoveField(
model_name='member',
name='gender',
),
migrations.RemoveField(
model_name='member',
name='involvement',
),
migrations.RemoveField(
model_name='member',
name='self_identification',
),
migrations.AlterField(
model_name='member',
name='date_of_birth',
field=models.DateField(blank=True, null=True),
),
]

5
bikeshop_project/registration/models.py

@ -48,7 +48,7 @@ class Member(AbstractBaseUser, PermissionsMixin):
first_name = models.CharField(max_length=255, null=False) first_name = models.CharField(max_length=255, null=False)
last_name = models.CharField(max_length=255, null=False) last_name = models.CharField(max_length=255, null=False)
preferred_name = models.CharField(max_length=255, null=True, blank=True) preferred_name = models.CharField(max_length=255, null=True, blank=True)
date_of_birth = models.DateField(null=True, blank=False) date_of_birth = models.DateField(null=True, blank=True)
guardian_name = models.CharField(max_length=255, null=True, blank=True) guardian_name = models.CharField(max_length=255, null=True, blank=True)
phone = models.CharField(max_length=20, null=True, blank=True) phone = models.CharField(max_length=20, null=True, blank=True)
street = models.CharField(max_length=255, null=True, blank=True) street = models.CharField(max_length=255, null=True, blank=True)
@ -56,9 +56,6 @@ class Member(AbstractBaseUser, PermissionsMixin):
province = models.CharField(max_length=255, null=True, blank=True) province = models.CharField(max_length=255, null=True, blank=True)
country = models.CharField(max_length=255, null=True, blank=True) country = models.CharField(max_length=255, null=True, blank=True)
post_code = models.CharField(max_length=20, null=True, blank=False) post_code = models.CharField(max_length=20, null=True, blank=False)
self_identification = models.CharField(max_length=255, null=True, blank=True)
gender = models.CharField(max_length=255, null=True, blank=True)
involvement = models.CharField(max_length=255, null=True, blank=True)
waiver = models.DateTimeField(null=True, blank=True) waiver = models.DateTimeField(null=True, blank=True)
is_active = models.BooleanField(default=True) is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False) is_admin = models.BooleanField(default=False)

Loading…
Cancel
Save