Hi,

I'm wondering if like in play or symfony you can develop special
method for each class/table in the models.py and use them in your
template.
I'm trying few things but it didn't work.

For exemple this is my models.py :
class Category(models.Model):
    name = models.CharField(max_length=250)

    def get_short_name():
                return name[0,20]

And here my html :
<div class="name">Desc : {{ category.get_short_name }} </div>

But it don t work, i'v got nothing in the screen.

What the correct way to do stuff like this, i m supposed to make a
custom tag in order to truncuate the name field ?

Thx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to