when = ~Q(**{ 'name' :
F('order_process__name') })
annotate = {
'has_name_divergence': Case(
When(when, then=True),
default=False,
output_field=CharField(),
),
}
When both fields have None value, the case result is true.
None != None
Using postgresSQL
--
Ticket URL: <https://code.djangoproject.com/ticket/32882>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Old description:
> Problems when comparing two fields in an annotate.
>
> when = ~Q(**{ 'name' :
> F('order_process__name') })
>
> annotate = {
> 'has_name_divergence': Case(
> When(when, then=True),
> default=False,
> output_field=CharField(),
> ),
> }
>
> When both fields have None value, the case result is true.
> None != None
> Using postgresSQL
New description:
Problems when comparing two fields in an annotate.
{{{
when = ~Q(**{ 'name' :
F('order_process__name') })
annotate = {
'has_name_divergence': Case(
When(when, then=True),
default=False,
output_field=CharField(),
),
}
}}}
When both fields have None value, the case result is true.
`None != None`
Using postgresSQL
--
Comment:
Duplicate of #29291.
> `None != None`. Using PostgreSQL.
`NULL` is not comparable.
--
Ticket URL: <https://code.djangoproject.com/ticket/32882#comment:1>