Django/Python best practice template_dict

Posted by fredrik on Stack Overflow See other posts from Stack Overflow or by fredrik
Published on 2010-05-18T13:38:32Z Indexed on 2010/05/18 14:50 UTC
Read the original article Hit count: 374

Filed under:
|

Hi,

After just been coding for about 6-9 months. I probably changed my coding style a number of times after reading some code or read best practices. But one thing I haven't yet come a cross is a good why to populate the template_dict.

As of now I pass the template_dict across a number of methods (that changes/modifies it) and returns is. The result is that every methods takes template_dict as first argument and the returns it and this in my eyes doesn't seems to be the best solution.

An idea is to have a method that handles all the changes. But I'm curios if there's a best practice for this? Or is it "do what you feel like"-type of thing?

The 2 things I think is pretty ugly is to send as an argument and return it in all methods. And the just the var name is written xxx number of times in the code :)

..fredrik

© Stack Overflow or respective owner

Related posts about python

Related posts about django