A different approach for filters
#128
Labels
enhancement
New feature, or existing feature improvement
Milestone
filters
#128
Hi, first of all, thanks for the useful library.
I want to perform some cleaning in some fields, for example, remove several
\n
in a row or strip some whitespaces. The cleanest way I found so far was to usefilters
in the field definition. This is not bad, but for instance, the methodclean_field()
that will be used as a filter can not be in the field container class (the form class) and only receive one argument (the field data). So I need to add the function globally or static in another class. Something like this:Is there a better way to do this? I was expecting something like, I can define inside the form class a method:
and that every method called
filter_<field_name>
will be called automatically by eitherForm.process()
method or a similar.Does this make any sense? I will be willing to implement this and provide tests but I'm not sure if this is wanted.
Thanks for your hard work with WTF :)
The text was updated successfully, but these errors were encountered: