Dear all,

In the new InstantCRUD I decided to take out the code for html forms generation and make a separate module for it.  After reading 'Rails-like form helpers' thread I think that this module might find a more general use.
I would like to ask you what intefrace would you propose for it.

It can build the HTML::Widgets based on some config and data from the database and then can also save the data from the widget to the database.  The config part is more complicated than it could be because the info about many-to-many relations is not available from the schema so you need to specify it in the config.  Since it is already there I've added also the stringification to it - as it is a bit cleaner to have it here in the interface part than overload stringification in the database schema definition.

The current interface is composed of just two functions:
 
Catalyst::Example::InstantCRUD::Widget->make_widget($interface_config, $class, $schema, $item);

$interface_config is a hash containing info about all db classes and how to wigetify them, $class is the db class, $schema is DBIC schema and $item is the db row to populate values in the form - its optional.

Catalyst::Example::InstantCRUD::Widget->populate_db($result, $item);

$result is HTML::Widget::Result and $item is the db row to be updated

So my question is do you think it deserves to be taken out from InstantCRUD and then what name would you propose for it?  How would you design the API?

--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to