#28086: Support Resolving F Expression in Custom DB Function
-------------------------------------+-------------------------------------
Reporter: Charlie McBride | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: F, Func | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Josh Smeaton):
* status: new => closed
* resolution: => invalid
Comment:
I'm closing this as invalid because there's no actual bug. You should post
to the #django-users mailing list or the #django IRC channel for
support/user questions like this.
That said - we don't always want to treat extra kwargs as expressions
themselves. Extra is used for passing around extra context that you might
want in a query, but arguments that are expressions *must* be processed as
expressions. That means adding them to `self.set_source_expressions()`,
and resolving them in `resolve_expressions`.
What I think you want to do is make your `__init__` method wrap any string
argument to tz_info in Value, and add it into your set_source_expressions
call. That way, if someone passes an F object, it'll be resolved as an
expression anyway. So don't pass tz_info around via extra - treat it as an
expression from the very start. It's exactly the reason we have the Value
expression in the first place. I hope that helps. If not, please continue
this topic on the django-users mailing list.
--
Ticket URL: <https://code.djangoproject.com/ticket/28086#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.7ff5424c28542bf43d6ab8a5882d7701%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.