Re: invoke model's method from template

2009-05-05 Thread Gabriel .
I just wrote an snippet, in case someone is interested. http://www.djangosnippets.org/snippets/1486/ -- Kind Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: invoke model's method from template

2009-05-05 Thread Gabriel .
On Tue, May 5, 2009 at 10:20 AM, Alex Gaynor wrote: > Yes, it's necessary to write your own tag, as you can't call methods that > take parameters from the template language. > > Alex > Thank you for the quick reply. I'll start working on it. -- Kind Regards --~--~-~--~~

Re: invoke model's method from template

2009-05-05 Thread Alex Gaynor
On Tue, May 5, 2009 at 3:18 PM, Gabriel . wrote: > > I have a model with a method, like: > > class Model .. > # class body > > def is_maintainer(user): > #method body > > Is there any way to invoke this method from a template ? > > {% if model.is_maintainer request.user %} # this doesn't

invoke model's method from template

2009-05-05 Thread Gabriel .
I have a model with a method, like: class Model .. # class body def is_maintainer(user): #method body Is there any way to invoke this method from a template ? {% if model.is_maintainer request.user %} # this doesn't work or should I write my own tag ? Kind Regards --~--~-~-