The typical usage for transforms is:
{{{
def as_sql(self, compiler, connection):
lhs_sql, lhs_params = compiler.compile(self.lhs)
# return the sql
}}}
I think it could make sense to add process_lhs() to transform base class.
This way one could write transforms using the same process_lhs() method
that is used for Lookups, too. At least for me it is hard to remember when
to use process_lhs() and when to use compiler.compile.
--
Ticket URL: <https://code.djangoproject.com/ticket/24886>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/24886#comment:1>
Comment (by jarshwah):
Could I suggest going the other way and standardising on
`compiler.compile` rather than `process_X`? I'm not sure how much work
process_lhs does in the normal lookups, so it may not be feasible. But I'd
like to standardise on the expressions way to ease the gap between them.
--
Ticket URL: <https://code.djangoproject.com/ticket/24886#comment:2>