#36934: BuiltinLookup breaks with params-as-a-tuple in django 6.0
-------------------------------------+-------------------------------------
     Reporter:  Stefan Bühler        |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:  6.0                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Hi,

 `BuiltinLookup` violates the new policy and returns a list of params from
 `process_lhs` and expects a list in `as_sql` (uses `.extend`).

 Lookup classes that inherit from (or mixed into) `BuiltinLookup` and
 overwrite `process_lhs` in a way that doesn't return a list of params
 (e.g. calling `Col.as_sql` through `compiler.compile(self.lhs)` are
 broken.

 Example: django-netfields: https://github.com/jimfunk/django-postgresql-
 
netfields/blob/f7529f2c97995dbc5b27ea7abcf0f2966269fd96/netfields/lookups.py#L27-L59

 The new policy: https://docs.djangoproject.com/en/6.0/releases/6.0
 /#custom-orm-expressions-should-return-params-as-a-tuple

 https://github.com/django/django/pull/20005 looks like it should fix this,
 and should be packported.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36934>
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019c711b3cc2-a4591b80-e342-4877-8fb5-868ca6f7d507-000000%40eu-central-1.amazonses.com.

Reply via email to