MCPcopy
hub / github.com/django/django / as_sql

Method as_sql

tests/custom_lookups/tests.py:201–211  ·  view source on GitHub ↗
(self, compiler, connection)

Source from the content-addressed store, hash-verified

199 lookup_name = "inmonth"
200
201 def as_sql(self, compiler, connection):
202 lhs, lhs_params = self.process_lhs(compiler, connection)
203 rhs, rhs_params = self.process_rhs(compiler, connection)
204 # We need to be careful so that we get the params in right
205 # places.
206 params = lhs_params + rhs_params + lhs_params + rhs_params
207 return (
208 "%s >= date_trunc('month', %s) and "
209 "%s < date_trunc('month', %s) + interval '1 months'" % (lhs, rhs, lhs, rhs),
210 params,
211 )
212
213
214class DateTimeTransform(models.Transform):

Callers

nothing calls this directly

Calls 2

process_lhsMethod · 0.45
process_rhsMethod · 0.45

Tested by

no test coverage detected