[Django] #24603: context.update() does not return a context manager like push()

8 views
Skip to first unread message

Django

unread,
Apr 8, 2015, 8:04:22 AM4/8/15
to django-...@googlegroups.com
#24603: context.update() does not return a context manager like push()
--------------------------------+------------------------------------------
Reporter: cjerdonek | Owner: nobody
Type: Uncategorized | Status: new
Component: Template | Version: 1.7
system |
Severity: Normal | Keywords: template,context,push,update
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------
The documentation says you can use `context.push()` as a context manager:

> You can also use `push()` as a context manager to ensure a matching
pop() is called.

And the documentation says this about `context.update()`:

> This works like `push()` but takes a dictionary as an argument and
pushes that dictionary onto the stack instead of an empty one.

However, `update()` doesn't seem to act as a context manager like `push()`
does (which I would have found useful). Is there a reason for the
difference? If the difference is deliberate, it seems like the
documentation should note this difference.

--
Ticket URL: <https://code.djangoproject.com/ticket/24603>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 8, 2015, 8:04:56 AM4/8/15
to django-...@googlegroups.com
#24603: context.update() does not return a context manager like push()
-------------------------------------+-------------------------------------

Reporter: cjerdonek | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage:
template,context,push,update | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by cjerdonek):

* cc: chris.jerdonek@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:1>

Django

unread,
Apr 8, 2015, 9:01:31 AM4/8/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: nobody
Type: New feature | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
template,context,push,update |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted
* type: Uncategorized => New feature
* version: 1.7 => master


Comment:

I guess it's probably not a feature that's been requested. See
a3e7d73ed7d90d31de46c60d40424267f62e411c for the addition of the context
manager to `push()`.

--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:2>

Django

unread,
Apr 13, 2015, 9:31:04 AM4/13/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: nobody

Type: New feature | Status: new
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
template,context,push,update |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by prestontimmons):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:3>

Django

unread,
Apr 13, 2015, 9:42:43 AM4/13/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: tbeadle
Type: New feature | Status: assigned

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
template,context,push,update |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by tbeadle):

* owner: nobody => tbeadle
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:4>

Django

unread,
Apr 13, 2015, 11:25:46 AM4/13/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: tbeadle
Type: New feature | Status: assigned
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
template,context,push,update |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by tbeadle):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:5>

Django

unread,
Apr 14, 2015, 7:49:02 AM4/14/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: tbeadle
Type: New feature | Status: assigned
Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
template,context,push,update | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:6>

Django

unread,
Apr 14, 2015, 8:03:23 AM4/14/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: tbeadle
Type: New feature | Status: closed

Component: Template system | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
template,context,push,update | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"6bfd864ff2a7d4903d485ee40094a1315da8221b" 6bfd864]:
{{{
#!CommitTicketReference repository=""
revision="6bfd864ff2a7d4903d485ee40094a1315da8221b"
Fixed #24603 -- Allowed Context.update() to be used as a context manager.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:7>

Django

unread,
Apr 14, 2015, 12:57:10 PM4/14/15
to django-...@googlegroups.com
#24603: Add the ability to use context.update() as a context manager
-------------------------------------+-------------------------------------
Reporter: cjerdonek | Owner: tbeadle
Type: New feature | Status: closed
Component: Template system | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
template,context,push,update | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by cjerdonek):

Wow, only six days -- thanks for adding this so quickly!

--
Ticket URL: <https://code.djangoproject.com/ticket/24603#comment:8>

Reply all
Reply to author
Forward
0 new messages