Django

Code

Show
Ignore:
Timestamp:
08/01/08 16:37:38 (4 months ago)
Author:
lukeplant
Message:

Fixed #3912 - Added simple type checking to template.Context.update() to help debugging broken context processors. Thanks Jeremy Dunck

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/template/context.py

    r6975 r8181  
    6363    def update(self, other_dict): 
    6464        "Like dict.update(). Pushes an entire dictionary's keys and values onto the context." 
     65        if not hasattr(other_dict, '__getitem__'):  
     66            raise TypeError('other_dict must be a mapping (dictionary-like) object.') 
    6567        self.dicts = [other_dict] + self.dicts 
    6668        return other_dict