Browse Source

Move membership to Member.

feature/python-error-tracking
Drew Larson 9 years ago
parent
commit
4a01e29b9f
  1. 19
      bikeshop_project/core/migrations/0009_remove_membership_member.py
  2. 22
      bikeshop_project/registration/migrations/0005_member_membership.py
  3. 7
      bikeshop_project/registration/models.py

19
bikeshop_project/core/migrations/0009_remove_membership_member.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-26 01:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20160526_0059'),
]
operations = [
migrations.RemoveField(
model_name='membership',
name='member',
),
]

22
bikeshop_project/registration/migrations/0005_member_membership.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-26 01:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0009_remove_membership_member'),
('registration', '0004_auto_20160410_1816'),
]
operations = [
migrations.AddField(
model_name='member',
name='membership',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='member', to='core.Membership'),
),
]

7
bikeshop_project/registration/models.py

@ -59,6 +59,13 @@ class Member(AbstractBaseUser, PermissionsMixin):
waiver = models.DateTimeField(null=True, blank=True)
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
membership = models.OneToOneField(
'core.Membership',
on_delete=models.CASCADE,
related_name='member',
blank=True,
null=True
)
objects = CustomMemberManager()

Loading…
Cancel
Save