How to save links in TextFields

Posted by xRobot on Stack Overflow See other posts from Stack Overflow or by xRobot
Published on 2010-05-20T12:45:05Z Indexed on 2010/05/21 22:30 UTC
Read the original article Hit count: 158

Filed under:
|

I have a simple Blog model with a TextField. What is the best way to save links in the TextField ?

1) Saving link in the database in this form: http://www.example.com and then using some filter in the template to trasform it in form:

<a rel="nofollow" href="http://www.example.com>http://www.example.com</a>

2) Saving link in the database directly in this form:

<a rel="nofollow" href="http://www.example.com>http://www.example.com</a>

© Stack Overflow or respective owner

Related posts about django

Related posts about django-templates