[html-formfu] More complex DBIC/FormFu interaction
Gabor HALASZ
halasz.g at freemail.hu
Tue Jan 18 10:54:15 GMT 2011
On 2011.01.14. 11:13, Moritz Onken wrote:
> I think FormFu should support a way to call a resultset method.
> You could move all the code there and just call it from FormFu.
> Example:
>
> in your Schema::ResultSet::Action;
>
> sub filter_for_form {
> shift->({ id => { '>' => 1 } }, { order_by => 'action' });
> }
>
> and then in FormFu:
>
>> <elements>
>> type Checkboxgroup
>> name actions
>> label_loc Action
>> reverse_group 0
>> <constraints>
>> type AutoSet
>> </constraints>
>> <model_config>
>> resultset Action
>> id_column id
>> label_column action
>> rs_method filter_for_form
>> </model_config>
>> </elements>
>
>
>
> This is not yet implemented, but would look much cleaner.
>
Hi!
I thinking about same thing, but in my opinion, the correct way to get
the whole resultset from stash, instead parts of resultset. In this
case, the whole magic of DBIC accessible to create forms, and placed
every component to a right place (model in database model, form prefill
logic in application/controller, and form description in config files).
And finally, I think, this not require an intensive extension of
Model::DBIC codebase.
--
Gabor HALASZ <halasz.g at freemail.hu>
More information about the HTML-FormFu
mailing list