#36922: AttributeError: 'tuple' object has no attribute 'extend' when using
Exists
-------------------------------------+-------------------------------------
Reporter: Julien Palard | Owner: (none)
Type: Bug | Status: closed
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):
* resolution: needsinfo => invalid
Comment:
Okay, I couldn't engineer a failing case. Please reopen if you can find
one using no third-party packages.
I think your problem is that `django-oscar` is subclassing `StartsWith` to
create a reverse starts with by [https://github.com/django-oscar/django-
oscar/blob/de217920de717fa894e40f425bfd61bc800721a2/src/oscar/apps/catalogue/abstract_models.py#L69
swapping `lhs_params` and `rhs_params`].
The 6.0 version of `StartsWith` is safe, because it calls `extend()` on
the params returned by `process_lhs()`, which is always a list. If you
change the return type of an internal by swapping the implementations like
this, all bets are off. You could vendor the more resilient version from
main, which is pretty much the advice in the release note you linked to
(always return params in a tuple from custom ORM expressions).
--
Ticket URL: <https://code.djangoproject.com/ticket/36922#comment:7>
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/0107019c526a0aa0-7a773f1c-d12c-41f9-9191-fd92a0d75a72-000000%40eu-central-1.amazonses.com.