[html-formfu] DBIx::Class::HTML::FormFu
Mario Minati
mario.minati at googlemail.com
Wed Sep 19 11:27:19 GMT 2007
On Wednesday 19 September 2007 11:36:29 Cosmin Budrica wrote:
> $relationship->populate_from_formfu(
> $form,
> );
>
> Works great, but what if I have another column in database that is not
> present on the form? Like an auto generated password.
> How do I add a value to it?
> Could always do after populating $relationship with an update, but that
> messes the "not null" constraint that a password should have.
At the moment you have the option to prefill your record, when created
with 'new', what doesn't meet your question.
The second possibility is to do these common processings inside of your DBIC
modell class y either overwriting 'update' yourself or using on the
DBIC::Class modules available on CPAN for digesting your data before the
update is being made.
I do that for UUIDs on my rows.
A third way is to include a hidden field in the form for which you change the
param value by hand before calling 'populate_from_formfu' which I would
consider to be an *ugly* hack.
An other possibility would be to define a callback for params digesting in the
call to 'populate_from_formfu' which is not coded jet - but you are welcome
to take care of that.
Greets,
Mario
More information about the HTML-FormFu
mailing list