On Thu, 9 Oct 2008 09:35:05 +0200, "Zbigniew Lukasiak" <[EMAIL PROTECTED]>
wrote:
> On Wed, Oct 8, 2008 at 7:02 PM, Octavian Rasnita <[EMAIL PROTECTED]>
> 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
>
>
You might want to have a look at this module
http://search.cpan.org/perldoc?DBIx::Class::EncodedColumn
AFAIK $form->save_to_model is deprecated and will be removed.
Use $form->model->update instead.
greets,
moritz
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu