Changes between Initial Version and Version 1 of Ticket #36373, comment 2


Ignore:
Timestamp:
May 7, 2025, 12:03:40 PM (10 days ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36373, comment 2

    initial v1  
    2121         self.remote_setter = klass_info["remote_setter"]
    2222}}}
     23
     24It might be worth adding a test with a model where pk fields are not defined next to each other or just alter the existing models to cover for that
     25
     26{{{#!diff
     27diff --git a/tests/composite_pk/models/tenant.py b/tests/composite_pk/models/tenant.py
     28index c85869afa7..a8dfd790f6 100644
     29--- a/tests/composite_pk/models/tenant.py
     30+++ b/tests/composite_pk/models/tenant.py
     31@@ -17,6 +17,7 @@ class Token(models.Model):
     32 class BaseModel(models.Model):
     33     pk = models.CompositePrimaryKey("tenant_id", "id")
     34     tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE)
     35+    between = models.IntegerField(null=True)
     36     id = models.SmallIntegerField(unique=True)
     37
     38     class Meta:
     39@@ -34,8 +35,8 @@ class Comment(models.Model):
     40         on_delete=models.CASCADE,
     41         related_name="comments",
     42     )
     43-    id = models.SmallIntegerField(unique=True, db_column="comment_id")
     44     user_id = models.SmallIntegerField()
     45+    id = models.SmallIntegerField(unique=True, db_column="comment_id")
     46     user = models.ForeignObject(
     47         User,
     48         on_delete=models.CASCADE,
     49}}}
Back to Top