[html-formfu] HTML-FormFu-DBIC

Carl Franks fireartist at gmail.com
Wed Nov 7 09:14:49 GMT 2007


On 06/11/2007, Brian Cassidy <brian.cassidy at nald.ca> wrote:
> Carl Franks wrote:
> > I spoke with zby a while ago about HTML-FormFu-DBIC, and this is what
> > was agreed:
> > At the moment, fill_formfu_values() and populate_from_formfu() are
> > copied in both DBIx-Class-HTML-FormFu and HTML-FormFu-DBIC.
> > So what we'll do is have them only in HTML-FormFu-DBIC as exportable
> > functions, and have DBIx-Class-HTML-FormFu import them.
>
> So, what exactly is the purpose of DBIx::Class::HTML::FormFu, or more
> precisely the dist "DBIx-Class-HTML-FormFu", other than a little bit of
> syntactic sugar for __PACKAGE__->load_components(...) ?

Good point.
Looking at DBIx-Class-HTML-FormFu, it doesn't even inherit from
DBIx-Class, so I guess we could simply have the functions exportable
from there, and forget about having a separate HTML-FormFu-DBIC
module.

I think, originally, zby wanted HTML-FormFu-DBIC to be a sub-class of
HTML-FormFu, but I didn't like that, because it means you have to
configure things like Catalyst-Controller-HTML-FormFu to know which
class to use.

I'm starting to wonder whether they should simply be core HTML-FormFu methods?

    $form->values_from_dbic( $row );
    $form->update_dbic( $row );

It should even be possible to make the methods agnostic to whether
they're given a form or a block, so instead of using the current
'nested_base' argument:

    $form->update_dbic( $row, { nested_base => 'foo' } );

You could do:

    $fieldset->update_dbic( $row );

Any thoughts?
Carl



More information about the HTML-FormFu mailing list