diff --git a/byro_shackspace/migrations/0002_auto_20180113_1330.py b/byro_shackspace/migrations/0002_auto_20180113_1330.py new file mode 100644 index 0000000..e30d74b --- /dev/null +++ b/byro_shackspace/migrations/0002_auto_20180113_1330.py @@ -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'), + ), + ] diff --git a/byro_shackspace/models.py b/byro_shackspace/models.py index 621970a..78085d6 100644 --- a/byro_shackspace/models.py +++ b/byro_shackspace/models.py @@ -1,8 +1,9 @@ +from annoying.fields import AutoOneToOneField from django.db import models class ShackProfile(models.Model): - member = models.ForeignKey( + member = AutoOneToOneField( to='members.Member', on_delete=models.CASCADE, related_name='profile_shack',