Re: Problem with in long text fields in templates
On Mon, 2009-04-20 at 09:47 -0700, NoviceSortOf wrote: > By digging around here in this group I found > an answer in using > > {{ book.description|safe }} > It's just a minor thing, since you said this content comes from data entry, but this allows all HTML in book.description to be displayed, including potentially unsafe elements
Re: Problem with in long text fields in templates
On Apr 20, 11:31 am, NoviceSortOfwrote: [...] > When attempt to using {{ book.description }} in the template, it > outputs all the tags onto the screen, > when what we want is actual line breaks. > [...] > > Can someone please give me a clue as to how to make this work or where > to find information to make this work. Check the Django docs for the filters linebreaks, linebreaksbr, and safe. http://docs.djangoproject.com/en/dev/ref/templates/builtins/#built-in-template-tags-and-filters --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Problem with in long text fields in templates
By digging around here in this group I found an answer in using {{ book.description|safe }} --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problem with in long text fields in templates
I've a template that displays descriptions of books. The descriptions are long text fields usually containing 1-3 paragraphs of text. Inside the text description during data entry tags are placed to indicate line breaks. When attempt to using {{ book.description }} in the template, it outputs all the tags onto the screen, when what we want is actual line breaks. I've attempted as well using {{ book.description|escape }} but that yields the same result. Obviously I'm missing part of the concept involved with displaying long text fields with embeded html via django . Can someone please give me a clue as to how to make this work or where to find information to make this work. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---