Make shack profile into OneToOneRel

This commit is contained in:
Tobias Kunze 2018-01-13 14:31:02 +01:00
parent f179ac2ccd
commit 48878ff1b0
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-13 13:30
from __future__ import unicode_literals
import annoying.fields
from django.db import migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('byro_shackspace', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='shackprofile',
name='member',
field=annoying.fields.AutoOneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile_shack', to='members.Member'),
),
]

View File

@ -1,8 +1,9 @@
from annoying.fields import AutoOneToOneField
from django.db import models from django.db import models
class ShackProfile(models.Model): class ShackProfile(models.Model):
member = models.ForeignKey( member = AutoOneToOneField(
to='members.Member', to='members.Member',
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name='profile_shack', related_name='profile_shack',