#15265: Problem with "__call__" method in Templates
-------------------------------------------+--------------------------------
Reporter: Stephane | Owner: nobody
Status: new | Milestone: 1.3
Component: Template system | Version: 1.3-beta
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 |
-------------------------------------------+--------------------------------
Changes (by anonymous):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Sorry, underscores are removed...
{{{
class MyDict(object):
TEST = {"var": "test", "meuh": "test2"}
def __getitem__(self, key):
"""
Retrieves a value. Raises a :exc:`KeyError` if *key* does not
exists.
"""
return MyDict.TEST[key]
def __call__(self, **kwargs):
"""
Puts one or more values into this...
"""
for key, value in kwargs.items():
self[key] = value
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/15265#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.