Re: Weird problem with rendering a Variable in a custom tag

2011-05-25 Thread bruno desthuilliers
On May 25, 4:43 am, stevedegrace wrote: > And you are absolutely correct, using a local variable in the render > method and not rebinding self,ip resolves the problem. Thank you very > much. Can you explain why this is? "Once a node is parsed, its render method may be called

Re: Weird problem with rendering a Variable in a custom tag

2011-05-24 Thread stevedegrace
And you are absolutely correct, using a local variable in the render method and not rebinding self,ip resolves the problem. Thank you very much. Can you explain why this is? On May 23, 5:34 am, bruno desthuilliers wrote: > On May 23, 5:37 am, stevedegrace

Re: Weird problem with rendering a Variable in a custom tag

2011-05-24 Thread stevedegrace
Thanks for the advice. I'm actually using this tag on a private moderation page to quickly satisfy my curiosity about which countries generate the most spam in my comments (FYI: Russia is winning hands down so far). On May 23, 10:24 am, Brice Leroy wrote: > Be careful will

Re: Weird problem with rendering a Variable in a custom tag

2011-05-23 Thread Brice Leroy
Be careful will computing location on rendering. IPs will change in time. The pattern is not clear but expect the information to expire. As you only extract the country, it shouldn't be an issue, but if you drill down to Zip code I would commend you to store it with the comment's author (less

Re: Weird problem with rendering a Variable in a custom tag

2011-05-23 Thread bruno desthuilliers
On May 23, 5:37 am, stevedegrace wrote: > I developed a custom tag to look up the country of a certain IP > address using an IP to country database. It's sort of rough and ready, > but it should work. The idea is that you read the comment.ip_address, > feed it to the {% country