Browse Source

Ugh.

feature/python-error-tracking
Drew Larson 9 years ago
parent
commit
23fc48593e
  1. 25
      bikeshop_project/core/migrations/0012_auto_20160531_0234.py
  2. 13
      bikeshop_project/core/models.py

25
bikeshop_project/core/migrations/0012_auto_20160531_0234.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-31 02:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0011_auto_20160531_0233'),
]
operations = [
migrations.RemoveField(
model_name='membership',
name='payment',
),
migrations.AddField(
model_name='payment',
name='membership',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='core.Membership'),
),
]

13
bikeshop_project/core/models.py

@ -9,12 +9,6 @@ class Membership(models.Model):
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)
payment = models.ForeignKey(
'Payment',
on_delete=models.CASCADE,
blank=False,
null=True
)
member = models.ForeignKey(
'registration.Member',
on_delete=models.CASCADE,
@ -34,6 +28,13 @@ class Payment(models.Model):
)
type = models.CharField(max_length=12, choices=payment_choices)
created_at = models.DateTimeField(auto_now_add=True)
membership = models.ForeignKey(
'Membership',
on_delete=models.CASCADE,
related_name='payments',
blank=False,
null=True
)
class Visit(models.Model):

Loading…
Cancel
Save