[html-formfu] Modify a submitted value before storing it in the database

Zbigniew Lukasiak zzbbyy at gmail.com
Thu Oct 9 08:35:05 BST 2008


On Wed, Oct 8, 2008 at 7:02 PM, Octavian Rasnita <orasnita at gmail.com> wrote:
> Hi,
>
> I want to add a new user from a FormFu form, using:
>
> my $new_user = $c->model("DB::TempUser")->new_result({hash => $hash});
>
> $form->save_to_model($new_user);
>
> But before adding the elements of the form in the database, I want to
> sha1_hex() the submitted password, which is one of the form fields.
>
> Please tell me what's the recommended way for doing this (and if the 2 lines
> above I use are the recommended way of inserting a new row in DB.)

TIMTOWTDI  - but one idea that worked for me in the past is to use a
deflator in DBIC:
http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/InflateColumn.pm

-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
http://perlalchemy.blogspot.com/



More information about the HTML-FormFu mailing list