On Thu, 2007-03-15 at 15:10 +0000, Jeff Forcier wrote:
> Oh, one more thing - here is one of the views whose data appears to be
> getting mixed up with the one I showed in the previous email, for
> reference:
> 
> ### views/engagements.py
> 
> def conflicts(request,**kwargs):
>     kwargs['extra_context']['object_list'] = cases.get_list()
>     kwargs['extra_context']['no_javascript'] = True
>     return base.render_with_roles(request,**kwargs)

Only noticed this after just replying, but it's entirely consistent with
what I said. You cannot do this and expect it to work. Make a deep copy
of the kwargs dict first, update that and pass that along:

        import copy
        new_kwargs = copy.deepcopy(kwargs)
        new_kwargs['extra_context']['object_list'] = ..
        
        # etc
        
Note that copy.deepcopy() is needed here to get a genuinely new instance
of the 'extra_context' dict. You can verify that by playing around at
the Python prompt (which I often have to do in order to get this sort of
thing completely correct). :-)

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to