#30719: Unable to use OuterRef(Expression(...))
-------------------------------------+-------------------------------------
     Reporter:  Matthew Schinckel    |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  Subquery, OuterRef,  |             Triage Stage:
  Expression                         |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

 Something seems off here, the `OuterRef` should not be nested. Did you
 mean

 {{{#!python
 staff = Person.objects.filter(
     first_name__iexact=Func(
         OuterRef('data'), Value('FirstName'),
 function='JSONB_EXTRACT_PATH_TEXT', output_field=models.TextField()
     )
 )
 return self.annotate(candidates=Array(staff.values('pk')))
 }}}

 If that's the case then yes I believe we should add support for that, I
 was under the impression it was already supported.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30719#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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.b4b90d58b8b98033a555f64d5f512290%40djangoproject.com.

Reply via email to