[jifty-devel] validator and filter order

John Green john at giggled.org
Wed Jan 3 15:12:54 EST 2007


Hi,

I have an IP address which I store in the database as an unsigned 32  
bit int.

I have added a validator to check it against RE{net}{IPv4} and also a  
filter to convert between dotted quad string and 32 bit unsigned  
integer (and back again).

Using the admin mode this worked fine when creating a new record, but  
fails when I try to save a record I have edited.  It appears to be  
calling the validator after the filter has been applied.

Is this the intended behaviour (if it is, the difference between the  
create and update behaviour seems wrong)?

Or am I going about this the completely wrong way (perhaps by  
subclassing Jifty::Web::Form::Field and using render_as)?

Thanks in advance,

John




More information about the jifty-devel mailing list