Hi, I don't know if the problem I have is the same as in http://lists.scsys.co.uk/pipermail/html-formfu/2008-January/000845.html . pmvers HTML::FormFu tells me that I am running FormFu 0.03005.
I have 3 tables (schemas automatically created by catalyst/dbix - many_to_many relations manually added): Band.pm: -------- (...) __PACKAGE__->table("bands"); __PACKAGE__->add_columns("id",{...},"name",{...}); (...) __PACKAGE__->has_many("bands_has_genres","My::Schema::BandsHasGenres",{"foreign.bands_id" => "self.id" }); __PACKAGE__->many_to_many(genres => "bands_has_genres", "genres_id"); Genres.pm: ---------- (...) __PACKAGE__->table("genres"); __PACKAGE__->add_columns("id",{...},"name",{...}); (...) __PACKAGE__->has_many("bands_has_genres","My::Schema::BandsHasGenres",{"foreign.genres_id" => "self.id" }); __PACKAGE__->many_to_many(bands => "bands_has_genres", "bands_id"); BandsHasGenres.pm ----------------- (...) __PACKAGE__->table("bands_has_genres"); __PACKAGE__->add_columns("id",{...},"bands_id",{...},"genres_id",{...}); (...) __PACKAGE__->belongs_to("bands_id","My::Schema::Bands",{ id => "bands_id" }); __PACKAGE__->belongs_to("genres_id","My::Schema::Genres",{ id => "genres_id" }); In my controller Band.pm: ------------------------- sub edit :Local :FormConfig { my ($self, $c, @args) = @_; my $bands = $c->model('My::Bands')->find($args[0]); my $form = $c->stash(myform); if ($form->submitted_and_valid) { (...) } else { my @mygenres = $bands->genres; my @genreobj = $c->model('My::Genres')->all(); my @genres; foreach my $g (@genreobj) { push(@genres, [$g->id, $g->name]); } my $select = $form->get_element({name => 'genres'}); $select->options([EMAIL PROTECTED]); my @myg; foreach my $g (@mygenres) { push(@myg, $g->id); } $select->default([EMAIL PROTECTED]); $form->model->default_values($bands); } } edit.yml of Band form: ---------------------- - type: Text name: name - type: Select name: genres Problem: -------- If I now want to edit a band, I get this "ambiguous" error message: DBIx::Class::ResultSetColumn::all(): DBI Exception: DBD::mysql::st execute failed: Column 'id' in field list is ambiguous [for Statement "SELECT id FROM bands_has_genres me JOIN genres genres_id ON ( genres_id.id = me.genres_id ) WHERE ( me.bands_id = ? )" with ParamValues: 0='7'] at /opt/aperl/ActivePerl-5.10/site/lib/HTML/FormFu/Model/DBIC.pm line 200 What am I doing wrong? -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu