From 342e3f0450f2a13fe3f2c99d0cc28d053592293e Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 21 Jan 2018 11:08:43 -0700 Subject: updated code to work with django 2.0 --- app/notes/build.py | 2 +- app/notes/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/notes') diff --git a/app/notes/build.py b/app/notes/build.py index 499adc6..dc0654e 100644 --- a/app/notes/build.py +++ b/app/notes/build.py @@ -1,5 +1,5 @@ import os -from django.core.urlresolvers import reverse +from django.urls import reverse from builder.base import BuildNew diff --git a/app/notes/models.py b/app/notes/models.py index 4e7824d..698ca14 100644 --- a/app/notes/models.py +++ b/app/notes/models.py @@ -31,7 +31,7 @@ class LuxNote(models.Model): body_html = models.TextField(blank=True) body_markdown = models.TextField('Note') point = models.PointField(blank=True, null=True) - location = models.ForeignKey(Location, blank=True, null=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, blank=True, null=True) PUB_STATUS = ( (0, 'Draft'), (1, 'Published'), @@ -88,7 +88,7 @@ class Note(models.Model): date_created = models.DateTimeField('Date', blank=True) date_last_updated = models.DateTimeField('Date', blank=True) point = models.PointField() - location = models.ForeignKey(Location, null=True, blank=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, null=True, blank=True) city_name = models.CharField(max_length=250, null=True, blank=True) state_name = models.CharField(max_length=250, null=True, blank=True) country_name = models.CharField(max_length=150, null=True, blank=True) -- cgit v1.2.3-70-g09d2