#24886: Add process_lhs() method for Transform
-------------------------------------+-------------------------------------
               Reporter:  akaariai   |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 The Lookup class has two methods, process_rhs() and process_lhs(). Typical
 usage is:
 {{{
 def as_sql(self, compiler, connection):
     lhs_sql, lhs_params = self.process_lhs(compiler, connection)
     rhs_sql, rhs_params = self.process_rhs(compiler, connection)
     # return the sql
 }}}

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.8914fa3762b78fb4eabb38d19cdc9c09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to