In this case will be a good pratice to use _ and __ to name that variables which you dont want to be used in views.
I see that if you have too many local vars the dict send to the view will be bigger. What is the better aproach in a matter of memory usage. A bigger dict available to the view or duplicating vars in cobtrollers? Enviado via iPhone Em 14/01/2011, às 09:21, Kenneth Lundström <[email protected]> escreveu: > Only thing that comes to my mind is that you can´t rename a variable. With > dict() method you can "rename" them. I don´t know if people do that. > > Traditional way, if you want to rename variable: > total_exposure_at_day_light_time = 365 > return dict(teadlt = total_exposure_at_day_light_time) > > new way: > total_exposure_at_day_light_time = 365 > teadlt = total_exposure_at_day_light_time > > return locals() > > you double the memory usage of variables. > > Kenneth > >> It's interesting, while I usually don't use so many variables in each >> controller. >> >> >> >> 2011/1/14 Bob <[email protected]> >> I see no downsides and seems that Massimo confirmed that. I already >> tried using return locals() and it works without issues. >> >> On 14 Ян, 07:37, pbreit <[email protected]> wrote: >> > Wait, so are you saying that instead of return dict(items=items, blah=blah, >> > etc) we can just use return locals() on most or all controllers? What's the >> > downside, memory? Implicitness? >> >> >> >> -- >> Atenciosamente >> >> >> Alexandre Andrade >> Hipercenter.com Classificados Gratuitos e Inteligentes >

