[html-formfu] HTML::FormFu::Model::DBIC and Many-to-many

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Tue Feb 3 13:00:53 GMT 2009


I'm really not getting how the many-to-many support works in this, so  
could someone mock me up an example.

I've attached 3 DBIC result definitions - for a superhero (with id and  
name) and a capability (id and name) and a map between them - cap_map  
which has superhero & capability columns (plus another one, power, for  
later).  The relations between the tables are defined.

What I would like to be able to do is build a form from a superhero  
object to select the capabilities that superhero has, so I would like  
the form to have something like a list of all the defined capabilities  
('Fly', Leap Buildings in a single bound', 'X-ray vision', 'Fire' etc)  
with a checkbox for each - ie has/has-not.

What would the form definition for that look like?

Also, if I then decided to rate each capability for each superhero, so  
Batman could leap very small buildings (so power of 2), whereas  
Superman could leap tall buildings (power 100), how could I produce a  
form with both has/has-not checkbox and a power rating?

[When I get my head round this I am happy to produce doc patches to  
clarify this in the modules...]

Cheers
	Nigel.

--
[ Nigel Metheringham             Nigel.Metheringham at InTechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SuperHero.pm
Type: text/x-perl-script
Size: 723 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20090203/0533b593/SuperHero.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CapMap.pm
Type: text/x-perl-script
Size: 817 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20090203/0533b593/CapMap.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capability.pm
Type: text/x-perl-script
Size: 723 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20090203/0533b593/Capability.bin


More information about the HTML-FormFu mailing list