mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #13987 -- Ensure that the primary key is set correctly for all models that have concrete-abstract-concrete inheritance, not just the first model. Thanks to Aramgutang for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -146,3 +146,20 @@ class BachelorParty(AbstractEvent):
|
||||
|
||||
class MessyBachelorParty(BachelorParty):
|
||||
pass
|
||||
|
||||
# Check concrete -> abstract -> concrete inheritance
|
||||
class SearchableLocation(models.Model):
|
||||
keywords = models.CharField(max_length=256)
|
||||
|
||||
class Station(SearchableLocation):
|
||||
name = models.CharField(max_length=128)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
class BusStation(Station):
|
||||
bus_routes = models.CommaSeparatedIntegerField(max_length=128)
|
||||
inbound = models.BooleanField()
|
||||
|
||||
class TrainStation(Station):
|
||||
zone = models.IntegerField()
|
||||
|
||||
Reference in New Issue
Block a user