mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #27742 -- Reverted "Fixed #24607 -- Serialized natural keys in multi-table inheritance models."
This reverts commit 74a575eb72 as it causes
unexpected migrations and doesn't seem to be the best solution.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
from django.db import models
|
||||
|
||||
|
||||
class ParentManager(models.Manager):
|
||||
def get_by_natural_key(self, parent_data):
|
||||
return self.get(parent_data=parent_data)
|
||||
|
||||
|
||||
class Parent(models.Model):
|
||||
parent_data = models.CharField(max_length=30, unique=True)
|
||||
|
||||
objects = ParentManager()
|
||||
|
||||
def natural_key(self):
|
||||
return (self.parent_data, )
|
||||
|
||||
|
||||
class Child(Parent):
|
||||
child_data = models.CharField(max_length=30, unique=True)
|
||||
Reference in New Issue
Block a user