Skip to content

Commit 20c77d6

Browse files
committed
Remove casting for array field
1 parent 91b8dc2 commit 20c77d6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changes/fix-array-field-bug.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Array custom fields get annotated correctly.

django_features/custom_fields/models/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _subquery(self, field: CustomField) -> Subquery:
5656
formated=Cast(
5757
(
5858
RawSQL(
59-
f"ARRAY(SELECT (jsonb_array_elements_text(value))::{field.sql_field})",
59+
"ARRAY(SELECT (jsonb_array_elements_text(value)))",
6060
[],
6161
)
6262
if field.multiple

0 commit comments

Comments
 (0)