Opened 4 years ago

Closed 4 years ago

Last modified 15 months ago

#24031 closed New feature (fixed)

Implement a Case/When expression

Reported by: Josh Smeaton Owned by: Michał Modzelewski
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords: 1.8-alpha
Cc: michal.modzelewski@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


#23753 has implemented a set of database functions. Originally it was going to implement a Case/When expression type, but the design and API is harder than the types listed in that ticket. So this one will track the implementation of only Case/When, and once implemented, we'll be able to close off #11305 (finally!)

Michal from the mailing list has a working proof of concept, and is developing his idea. See here:!topic/django-developers/a5ADv59TkBQ

Change History (8)

comment:1 Changed 4 years ago by Tim Graham

Keywords: 1.8-alpha added
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

comment:2 Changed 4 years ago by Josh Smeaton

Has patch: set
Needs documentation: set
Patch needs improvement: set

comment:3 Changed 4 years ago by Michał Modzelewski

Cc: michal.modzelewski@… added
Owner: changed from nobody to Michał Modzelewski
Status: newassigned

comment:4 Changed 4 years ago by Josh Smeaton

Needs documentation: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 65246de7b1d70d25831ab394c4f4a75813f629fe:

Fixed #24031 -- Added CASE expressions to the ORM.

comment:6 Changed 4 years ago by Simon Charette <charette.s@…>

In 47bdad4e6b3bf70aec0d19d65eeb6a7319ad045a:

Replaced inner functions by class methods.

refs #24031

Thanks to Tim Graham and Michał Modzelewski for the review.

comment:7 Changed 16 months ago by Tim Graham <timograham@…>

In 1dafd8cb:

Refs #24031 -- Added test for When.repr().

comment:8 Changed 15 months ago by Tim Graham <timograham@…>

In 5114669f:

Refs #24031 -- Added test for Case and When constructor arguments.

Note: See TracTickets for help on using tickets.
Back to Top