From 8c0c84eb4994dd98bab9a69dca1b96ed3f158ffa Mon Sep 17 00:00:00 2001 From: Nikolai R Kristiansen Date: Sat, 17 Mar 2018 13:09:43 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8FDjango=202.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dpdapi/migrations/0001_initial.py | 4 ++-- dpdapi/models.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dpdapi/migrations/0001_initial.py b/dpdapi/migrations/0001_initial.py index 83d93ed..6cce1d7 100644 --- a/dpdapi/migrations/0001_initial.py +++ b/dpdapi/migrations/0001_initial.py @@ -46,7 +46,7 @@ class Migration(migrations.Migration): ('updated', models.DateTimeField(auto_now=True)), ('email', models.EmailField(unique=True, max_length=254)), ('password', models.CharField(max_length=109)), - ('domain', models.ForeignKey(to='dpdapi.Domain')), + ('domain', models.ForeignKey(to='dpdapi.Domain', on_delete=models.CASCADE)), ], options={ 'abstract': False, @@ -56,7 +56,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='alias', name='domain', - field=models.ForeignKey(to='dpdapi.Domain'), + field=models.ForeignKey(to='dpdapi.Domain', on_delete=models.CASCADE), preserve_default=True, ), ] diff --git a/dpdapi/models.py b/dpdapi/models.py index 2447983..2a027f5 100644 --- a/dpdapi/models.py +++ b/dpdapi/models.py @@ -12,7 +12,7 @@ class BaseModel(models.Model): class Alias(BaseModel): source = models.EmailField(max_length=254) destination = models.EmailField(max_length=254) - domain = models.ForeignKey('dpdapi.Domain') + domain = models.ForeignKey('dpdapi.Domain', models.CASCADE) active = models.BooleanField(default=True) def __str__(self): @@ -44,7 +44,7 @@ class Domain(BaseModel): class User(BaseModel): email = models.EmailField(max_length=254, unique=True) password = models.CharField(max_length=109) - domain = models.ForeignKey('dpdapi.Domain') + domain = models.ForeignKey('dpdapi.Domain', models.CASCADE) def __str__(self): return self.email diff --git a/requirements.txt b/requirements.txt index c0b1fea..76e23e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==1.11.11 +Django==2.0.3 django-extensions==2.0.6 django-filter==1.1.0 djangorestframework==3.7.7