#22288: F() expression not compatible with __range field look up
-------------------------------------+-------------------------------------
     Reporter:  liushaohua86@…       |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by timgraham:

Old description:

> class TestModel(models.Model):
>     a = models.SmallIntegerField()
>     b = models.SmallIntegerField()
>
> TestModel.objects.filter(a__range=(F('b')-1, F('b')+1)
>
> TypeError: int() argument must be a string or a number, not
> 'ExpressionNode'

New description:

 {{{
 class TestModel(models.Model):
     a = models.SmallIntegerField()
     b = models.SmallIntegerField()

 TestModel.objects.filter(a__range=(F('b')-1, F('b')+1)

 TypeError: int() argument must be a string or a number, not
 'ExpressionNode'
 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/22288#comment:8>
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/080.0110a5804891d812664908fe221390d4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to