[html-formfu] Model::DBIC: Support for additional rows in m2m rels
and link values
Moritz Onken
onken at houseofdesign.de
Thu Aug 6 17:03:06 GMT 2009
Hi Carl,
hope you had nice holidays :-)
Here is a patch which adds some functionality to Model::DBIC
from the docs:
If you want to set columns on the link table you can do so if you add a
C<link_values> attribute to C<model_config>:
---
element:
- type: Checkboxgroup
name: authors
model_config:
link_values:
foo: bar
The default implementation will first remove all related objects and
set the
new ones (see L<http://search.cpan.org/perldoc?DBIx::Class::Relationship::Base#set_$rel
>).
If you want to add the selected objects to the current set of objects
set C<additive> in the C<model_config>.
---
element:
- type: Checkboxgroup
name: authors
model_config:
additive: 1
options_from_model: 0
(<options_from_model> is set to C<0> because this L</
options_from_model> will try to fetch
all objects from the result class C<Authors> if C<model_config> is
specified
without a C<resultset> attribute.)
It would be great if you could include this in the next release.
I can commit it if you want me to.
cheers,
moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link_value_additive.patch
Type: application/octet-stream
Size: 5773 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20090806/7cc77c4d/link_value_additive.obj
More information about the HTML-FormFu
mailing list