Re: how to use model name in templates

2010-01-25 Thread Bill Freeman
You are defining a method of the class. That requires a "self" argument, even if you are not using it in the body. Attempting to call it will raise an error. So, either make that line: def modelName(self): Or declare it to be a staticmethod, which can still be called via an instance, but w

how to use model name in templates

2010-01-25 Thread Ali Rıza Keleş
Hi, How can I use model name in Templates? I tried something like this: Firstly model is here, class ModelNameXxxx(models.Model): field = . def modelName(): return "ModelNameXxxx" and in template side: {{ p.modelName }}