Opened 3 years ago
Closed 3 years ago
#32882 closed Bug (duplicate)
Problems when comparing two fields with None value using F() in Case()
Reported by: | Jonathan Souza | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 2.2 |
Severity: | Normal | Keywords: | F() Case() None != None |
Cc: | jnt.santos12@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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
Change History (1)
comment:1 by , 3 years ago
Description: | modified (diff) |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Duplicate of #29291.
NULL
is not comparable.