(self, lhs, rhs)
| 253 | |
| 254 | class ArrayRHSMixin: |
| 255 | def __init__(self, lhs, rhs): |
| 256 | # Don't wrap arrays that contains only None values, psycopg doesn't |
| 257 | # allow this. |
| 258 | if isinstance(rhs, (tuple, list)) and any(self._rhs_not_none_values(rhs)): |
| 259 | expressions = [] |
| 260 | for value in rhs: |
| 261 | if not hasattr(value, "resolve_expression"): |
| 262 | field = lhs.output_field |
| 263 | value = Value(field.base_field.get_prep_value(value)) |
| 264 | expressions.append(value) |
| 265 | rhs = Func( |
| 266 | *expressions, |
| 267 | function="ARRAY", |
| 268 | template="%(function)s[%(expressions)s]", |
| 269 | ) |
| 270 | super().__init__(lhs, rhs) |
| 271 | |
| 272 | def process_rhs(self, compiler, connection): |
| 273 | rhs, rhs_params = super().process_rhs(compiler, connection) |
nothing calls this directly
no test coverage detected