mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #24958 -- Fixed inline forms using UUID-PK parents with auto-PK children.
This commit is contained in:
@@ -254,3 +254,33 @@ class UUIDPKChild(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=255)
|
||||
parent = models.ForeignKey(UUIDPKParent)
|
||||
|
||||
|
||||
class ChildWithEditablePK(models.Model):
|
||||
name = models.CharField(max_length=255, primary_key=True)
|
||||
parent = models.ForeignKey(UUIDPKParent)
|
||||
|
||||
|
||||
class AutoPKChildOfUUIDPKParent(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
parent = models.ForeignKey(UUIDPKParent)
|
||||
|
||||
|
||||
class AutoPKParent(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
|
||||
class UUIDPKChildOfAutoPKParent(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=255)
|
||||
parent = models.ForeignKey(AutoPKParent)
|
||||
|
||||
|
||||
class ParentWithUUIDAlternateKey(models.Model):
|
||||
uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=False)
|
||||
name = models.CharField(max_length=50)
|
||||
|
||||
|
||||
class ChildRelatedViaAK(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
parent = models.ForeignKey(to=ParentWithUUIDAlternateKey, to_field='uuid')
|
||||
|
||||
Reference in New Issue
Block a user