[html-formfu] Creating options in many_to_many_select
Zbigniew Lukasiak
zzbbyy at gmail.com
Sun Dec 16 00:16:00 GMT 2007
Thanks for the explanation. Is it possible to decouple it from
Catalyst by putting the schema on the stash?
I know FormFu is mostly used with Catalyst - but you never know and
beside that it would simplify testing.
Cheers,
Zbyszek
On Dec 16, 2007 12:06 AM, Carl Franks <fireartist at gmail.com> wrote:
> On 15/12/2007, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
> >
> > It looks that the ->defaults_from_model method sets the default values
> > but it does not create the full list of options.
>
> > Is that a conscious omission - do you think users should fill in the
> > options themselves or would you welcome a patch?
>
> Yes, it's on purpose. defaults_from_model() is purely for default values.
>
> There's currently experimental support in Element/_Group to populate
> from dbic if you're using the cat controller.
> This works for Select, Radiogroup + Checkboxgroup, which all inherit
> from _Group.
>
> - type: Select
> name: foo
> db:
> model: MyModel
>
> See the source of _Group::process() for details.
> If you don't explicitly set the value or label columns, it'll
> automatically use the PK and the first text/varchar columns in the
> table.
>
> Carl
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.rawmode.org
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>
--
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
More information about the HTML-FormFu
mailing list