[html-formfu] Updating 2 tables

Carl Franks fireartist at gmail.com
Mon Feb 15 15:36:22 GMT 2010


The example config in this documentation:
http://search.cpan.org/~cfranks/HTML-FormFu-Model-DBIC-0.06000/lib/HTML/FormFu/Model/DBIC.pm#might_have_and_has_one_relationships
should work for this.

That error message is incorrect - it should read "nested_name" - not
nested_names

Carl


On 14 February 2010 00:50, Octavian Rasnita <orasnita at gmail.com> wrote:
> Hi,
>
> I have 2 dependent tables with the following structure:
>
> create table communique(
> id int unsigned not null auto_increment primary key,
> last_modified timestamp not null default current_timestamp,
> type varchar(255) not null default ""
> ) engine=InnoDB default charset=utf8;
>
> create table aga(
> id int unsigned not null auto_increment primary key,
> communique int unsigned not null,
> detail text,
> unique index(communique),
> constraint foreign key(communique) references communique(id) on delete
> cascade
> ) engine=InnoDB default charset=utf8;
>
> And I want to use Catalyst::Controller::HTML::FormFu to update both tables.
>
> I have created the following form:
>
>
> <model_config>
> resultset Communique
> </model_config>
>
> <elements>
> name last_modified
> type DateTime
> label Last modified:
> </elements>
>
> <elements>
> name type
> type Text
> label Type:
> </elements>
>
> <elements>
> name agas.detail
> type Textarea
> label Details:
> </elements>
>
> There is a relation named "agas" between communique and aga tables and I was
> hoping that by using agas.detail, it would get/set the value from that
> field, however unfortunately HTML::FormFu doesn't have this feature
> (although it would be great).
>
> It gave the following error on form rendering:
>
> "Caught exception in Fu::Controller::Com->add "element names may not contain
> periods or square brackets
> see documentation on nested_names() for details"
>
> I have searched for documentation about "nested_names" but I couldn't find
> anything.
>
> Maybe HTML::FormFu doesn't support multiple table updates by just using a
> config file, but I hope there is a more elegant way of doing these updates
> than getting the values from the form and making the DBIC updates manually.
>
> Does anyone know if nested_names() and the other related methods can help me
> to update more tables from a single form?
>
> Thank you for any information regarding this.
>
> Octavian
>
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>



More information about the HTML-FormFu mailing list