summaryrefslogtreecommitdiff
path: root/tests/gis_tests/relatedapp/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gis_tests/relatedapp/models.py')
-rw-r--r--tests/gis_tests/relatedapp/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/gis_tests/relatedapp/models.py b/tests/gis_tests/relatedapp/models.py
index baa1e7ff33..606b40c52a 100644
--- a/tests/gis_tests/relatedapp/models.py
+++ b/tests/gis_tests/relatedapp/models.py
@@ -24,7 +24,7 @@ class Location(SimpleModel):
class City(SimpleModel):
name = models.CharField(max_length=50)
state = models.CharField(max_length=2)
- location = models.ForeignKey(Location)
+ location = models.ForeignKey(Location, models.CASCADE)
def __str__(self):
return self.name
@@ -38,13 +38,13 @@ class AugmentedLocation(Location):
class DirectoryEntry(SimpleModel):
listing_text = models.CharField(max_length=50)
- location = models.ForeignKey(AugmentedLocation)
+ location = models.ForeignKey(AugmentedLocation, models.CASCADE)
@python_2_unicode_compatible
class Parcel(SimpleModel):
name = models.CharField(max_length=30)
- city = models.ForeignKey(City)
+ city = models.ForeignKey(City, models.CASCADE)
center1 = models.PointField()
# Throwing a curveball w/`db_column` here.
center2 = models.PointField(srid=2276, db_column='mycenter')
@@ -63,12 +63,12 @@ class Author(SimpleModel):
class Article(SimpleModel):
title = models.CharField(max_length=100)
- author = models.ForeignKey(Author, unique=True)
+ author = models.ForeignKey(Author, models.CASCADE, unique=True)
class Book(SimpleModel):
title = models.CharField(max_length=100)
- author = models.ForeignKey(Author, related_name='books', null=True)
+ author = models.ForeignKey(Author, models.SET_NULL, related_name='books', null=True)
class Event(SimpleModel):