Malcolm Tredinnick said the following:
> On Mon, 2007-08-13 at 18:18 -0700, sime wrote:
>> 6. Maybe allow clean_method=x in field parameters, rather than have to
>> create a custom field or repeat similar clean functions.
>
> You can do that one in this fashion...
>
> class MyForm(Form)
> field1 = ...
> field2 = ...
>
> def generic_clean(self):
> # ...
>
> clean_field1 = generic_clean
> clean_field2 = generic_clean
>
> The generic_clean method can even be outside the class (although it will
> be called as a method function, so it needs to have the right
> signature).
Actually, this method won't work very well unless the clean_FOO methods
are changed to take the value, since you'd have to know which field it's
being called for. :)
Unless that change does make it in, I don't see how you could do
anything at all in there, unless you just wanted to return a static value :)
--
Collin Grady
I'm going to Boston to see my doctor. He's a very sick man.
-- Fred Allen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---