1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #36062 -- Handled serialization of CompositePrimaryKeys.

This commit is contained in:
Sarah Boyce
2025-01-06 11:40:05 +01:00
parent 15e207ce80
commit 6a1a9c0ead
6 changed files with 84 additions and 3 deletions

View File

@@ -48,3 +48,9 @@ class Post(models.Model):
pk = models.CompositePrimaryKey("tenant_id", "id")
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE)
id = models.UUIDField()
class TimeStamped(models.Model):
pk = models.CompositePrimaryKey("id", "created")
id = models.SmallIntegerField(unique=True)
created = models.DateTimeField(auto_now_add=True)