On 5/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> One question I've been trying to get answered before I start messing
> around with the project is input validation. Specifically html.

Django lets you hook a list of validator functions to any field in any
model [1]; there's a set of built-in validators [2] which cover a lot
of common cases, but I don't think there's one which lets you specify
the particular tags you want to allow/disallow. You might want to take
a look at how the built-in validators are implemented [3] to get a
feel for how to write one that'd be appropriate to your situation. If
there's not already a cookbook script out there to strip all but a
particular subset fo tags, a good place to start would be with
Python's built-in HTMLParser module [4], which will probably feel
familiar if you've ever used PHP's SAX module.

[1] http://www.djangoproject.com/documentation/model_api/#validator-list
[2] http://www.djangoproject.com/documentation/forms/#validators
[3] http://code.djangoproject.com/browser/django/trunk/django/core/validators.py
[4] http://docs.python.org/lib/module-HTMLParser.html

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

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

Reply via email to