#31783: Filtering on a field named `negate` raises a TypeError
-------------------------------------+-------------------------------------
               Reporter:  Aaron      |          Owner:  nobody
  Kirkbride                          |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  3.0
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Filtering on a model with a field named `negate` raises a `TypeError`.

 For example:
 {{{
 class Foo(models.Model):
     negate = models.BooleanField()

 Foo.objects.filter(negate=True)
 }}}

 raises `TypeError: _filter_or_exclude() got multiple values for argument
 'negate'`

 `negate` is not documented as a reserved argument for `.filter()`. I'm
 currently using `.filter(negate__exact=True)` as a workaround.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31783>
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/049.5823e87e3a98be2a394ca05ed6a09736%40djangoproject.com.

Reply via email to