Opened 10 years ago

Closed 10 years ago

#24493 closed New feature (fixed)

Add setdefault to BaseContext

Reported by: Preston Timmons Owned by: nobody
Component: Template system Version: dev
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 by Preston Timmons, 10 years ago

Has patch: set

comment:2 by Tim Graham, 10 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In 388e79e9:

Fixed #24493 -- Added BaseContext.setdefault()

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