> I'm preparing my site for general consumption and would prefer that
> naughty words not be presented in usernames or on public pages. Is
> there a recommended way of filtering out the uncouth?

Django comes with a naughty-word filter/validator,
hasNoProfanities.  Just set the PROFANITIES_LIST in your
settings.py to be the list of words you don't want to include.  I
believe there's already a modest default list detailed in
conf/global_settings.py but you can enhance to include your own
favorites.

Thus, you can use

  class MyModel(Model):
    comment_field = TextField(...,
      validator_list=[hasNoProfanities]
      )

It might take some monkey-patching or a bit of hacking to get it
into the Django auth system, though it might not make a bad
default validator for the username. :)

http://www.djangoproject.com/documentation/forms/#validators
http://www.djangoproject.com/documentation/settings/#profanities-list

The above are used for preventing the data from getting into the
system in the first place.

If you want to allow the content into the system, but filter it
based on the user, you would have to create your own template
filter (not a hard task) which could be based on the
hasNoProfanities code.

-tim




--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to