[html-formfu] Re: refactoring defaults_from_model (DBIC)

Zbigniew Lukasiak zzbbyy at gmail.com
Sat Jan 19 07:25:20 GMT 2008


On Jan 19, 2008 3:03 AM, Вячеслав Тихановский <viacheslav.t at gmail.com> wrote:
> 2008/1/18, Zbigniew Lukasiak <zzbbyy at gmail.com>:
>
> > On Jan 18, 2008 5:03 PM, Carl Franks <fireartist at gmail.com> wrote:
> > >
> > >
> > > I noticed that the refactor had reverted back to the old behaviour of
> > > always using get_column() - I've fixed that so that it uses
> > > $row->$name() accessors (when it doesn't clash with a rel name), and
> > > added tests to ensure that DBIC column inflators are being run.
> >
> > Ah - I was actually thinking about that - but I forgot about the
> > inflators - sorry.
> >
> > By the way in my code I've started to make sure that rels have
> > different names than columns - this way I can alway call
> > $row->$name().
> >
> > Cheers,
> > Zbyszek
> > http://perlalchemy.blogspot.com/
>
> >From svn (r787) my code breaks like this:
>
> Can't call method "result_source" without a package or object
> reference at /home/...perl5/site_perl/5.8.8/HTML/FormFu/Model/DBIC.pm
> line 71.
>
> After i rolled back to r776 everything worked fine as expected.

Check out the new version.  I think I've fixed that bug.  Yesterday I
discovered that the new version would recurse in defaults_from_model
for nested blocks that are not relations (like Date) - the result is
the error you received.

I've also added some tests in that commit - I hope I did not forget
about something.

Cheers,
Zbigniew
http://perlalchemy.blogspot.com/


More information about the HTML-FormFu mailing list