Opened 5 years ago

Closed 5 years ago

#24493 closed New feature (fixed)

Add setdefault to BaseContext

Reported by: Preston Timmons Owned by: nobody
Component: Template system Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Since context defines other dict-like methods, it'd be nice if it supported setdefault, too. My use case is initializing the extends history in render_context if it exists, otherwise using the value that is already there.

It's not critical, but it makes things more readable.

Change History (3)

comment:1 Changed 5 years ago by Preston Timmons

Has patch: set

comment:2 Changed 5 years ago by Tim Graham

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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

Resolution: fixed
Status: newclosed

In 388e79e9:

Fixed #24493 -- Added BaseContext.setdefault()

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