summaryrefslogtreecommitdiff
path: root/django/db/backends/sqlite3/operations.py
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2026-02-11 23:25:47 +0000
committerJacob Walls <jacobtylerwalls@gmail.com>2026-02-12 15:27:11 -0500
commit055d7a682f4923fc5a50d7c1a12fd7f52675f7e8 (patch)
treef0f412259d1bf42a81f7ee22f6d485caba35a960 /django/db/backends/sqlite3/operations.py
parent0dd9d5ee5c30e51754d93e926e24ff92654ecf5d (diff)
Improved error message in SQLite `DatabaseOperations.check_expression_support()`.
Diffstat (limited to 'django/db/backends/sqlite3/operations.py')
-rw-r--r--django/db/backends/sqlite3/operations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py
index 33a39239ca..949cbd4ff9 100644
--- a/django/db/backends/sqlite3/operations.py
+++ b/django/db/backends/sqlite3/operations.py
@@ -48,10 +48,10 @@ class DatabaseOperations(BaseDatabaseOperations):
pass
else:
if isinstance(output_field, DATETIME_FIELDS):
+ klass = expression.__class__.__name__
raise NotSupportedError(
- "You cannot use Sum, Avg, StdDev, and Variance "
- "aggregations on date/time fields in sqlite3 "
- "since date/time is saved as text."
+ f"SQLite does not support {klass} on date or time "
+ "fields, because they are stored as text."
)
if (
isinstance(expression, models.Aggregate)