[html-formfu] Config generator

Zbigniew Lukasiak zzbbyy at gmail.com
Thu Mar 13 21:33:45 GMT 2008


On Thu, Mar 13, 2008 at 10:24 PM, Byron Young <Byron.Young at riverbed.com> wrote:
> Zbigniew Lukasiak wrote:
>  > Hi there,
>  >
>  > I've made a new version of the config generator - see the attachment.
>
>  Hey Zbigniew,
>
>  I think it's very useful.  Thanks!
>
>  However, I think I've found a problem with how it handles belongs_to relationships.  In my [very limited] usage of HTML::FormFu, belongs_to ought to be represented with a Block, like so:
>
>   - type: Block
>     elements:
>       - type: Select
>         name: belongs_to
>         label: Belong_to
>         attributes:
>           title: Pick something from the other table
>         model_config:
>           DBIC:
>             model: DB::ForeignTable
>
>
>  Instead, your generator creates a Repeatable, which seems to me to only make sense in the has_many case (or many_to_many), since with belongs_to you can only have one item from the foreign table.
>
>  Are my assumptions wrong?  Since I am a FormFu noob, I wouldn't be surprised if the way I'm using it is not standard convention.

Certainly this is not a finished product yet.  With belongs_to I have
a problem - because there are two logical configs for it - it can be a
Select like yours (I ton't think it needs the outer Block in that
case) - but it can also be a nested Block with multiple elements that
would let you change the values in the record that is the 'owner' of
the original one.  I think the Select would be the more popular
arrangement - so for the first version I'll do that - but what should
be the best way to cope with that?  A config option for the config
generator?  Maybe output both and let the user delete the one that is
not needed?  Or maybe 'comment out' the less popular option?

Cheers,
Zbigniew

>
>  Regards,
>  Byron
>
>
>
>  _______________________________________________
>  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