Login

Snippets by DvD

Snippet List

CleanCharField

I was about to start an online community but every time you allow people to post something as a comment you never know what they come up to, especially regarding profanities. So I come up with this idea, I put together some code from the old style form validators and the new newform style, plus some code to sanitize HTML from snippet number [169](http://www.djangosnippets.org/snippets/169/), and the final result is a CharField that only accept values without swear words, profanities, curses and bad html. Cheers.

  • validator
  • newforms
  • forms
  • html
  • sanitize
  • profanities
Read More
Author: DvD
  • -2
  • 0

DvD has posted 1 snippet.