{{ post.subject|slice:":15"|escape }} does the job. On Aug 20, 6:55 am, patrickk <[EMAIL PROTECTED]> wrote: > thanks. > > since truncatewords and truncatewords_html are predefined filters, I > guess that truncate should also be one (just my opinion). > > patrick > > On 20 Aug., 12:33, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > On Mon, 2007-08-20 at 11:52 +0200, patrickk wrote: > > > how do I truncate a string (in the template) after a certain amount > > > of characters? > > > I know thereĀ“s a truncate-filter, but it works with words and not > > > characters. > > > There's #5025 in Trac. > > > This shouldn't be seen as any endorsement for that ticket, since I'm not > > convinced it belongs in core and haven't really worried about making any > > kind of decision. But you can try it out for your own purposes (use it > > to create a filter in your app, for example). > > > Regards, > > Malcolm > > > -- > > The early bird may get the worm, but the second mouse gets the > > cheese.http://www.pointy-stick.com/blog/
--~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---