summaryrefslogtreecommitdiff
path: root/tests/annotations/models.py
diff options
context:
space:
mode:
authorDevin Cox <dcox@surefyre.co>2024-08-09 13:56:56 -0700
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-08-12 15:35:19 +0200
commite03083917db03757e48f8edac4c8491b72c8a3c4 (patch)
tree9b96fb24ab403cc56d5510e74d23a70eeab207fa /tests/annotations/models.py
parent228128618bd895ecad235d2215f4ad4e3232595d (diff)
Fixed #35586 -- Added support for set-returning database functions.
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres. Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'tests/annotations/models.py')
-rw-r--r--tests/annotations/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/annotations/models.py b/tests/annotations/models.py
index fbb9ca6988..914770d2fe 100644
--- a/tests/annotations/models.py
+++ b/tests/annotations/models.py
@@ -58,3 +58,11 @@ class Company(models.Model):
class Ticket(models.Model):
active_at = models.DateTimeField()
duration = models.DurationField()
+
+
+class JsonModel(models.Model):
+ data = models.JSONField(default=dict, blank=True)
+ id = models.IntegerField(primary_key=True)
+
+ class Meta:
+ required_db_features = {"supports_json_field"}