mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #15776 - delete regression in Django 1.3 involving nullable foreign keys
Many thanks to aaron.l.madison for the detailed report and to emulbreh for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -51,3 +51,19 @@ class Food(models.Model):
|
||||
class Eaten(models.Model):
|
||||
food = models.ForeignKey(Food, to_field="name")
|
||||
meal = models.CharField(max_length=20)
|
||||
|
||||
|
||||
# Models for #15776
|
||||
|
||||
class Policy(models.Model):
|
||||
policy_number = models.CharField(max_length=10)
|
||||
|
||||
class Version(models.Model):
|
||||
policy = models.ForeignKey(Policy)
|
||||
|
||||
class Location(models.Model):
|
||||
version = models.ForeignKey(Version, blank=True, null=True)
|
||||
|
||||
class Item(models.Model):
|
||||
version = models.ForeignKey(Version)
|
||||
location = models.ForeignKey(Location, blank=True, null=True)
|
||||
|
||||
Reference in New Issue
Block a user