I've simplified it even further - by getting rid of the $attrs parameter for the internal functions. The new file is attached.
Zbigniew On Jan 12, 2008 4:54 PM, Zbigniew Lukasiak <[EMAIL PROTECTED]> wrote: > Hi all, > > I've changed defaults_from_model. Instead of scanning the db fields of > the given row and then matching them against form fields - I made it > walk through the form fields and match them against the db fields. > That let me reduce the code twice ( in line numbers and number of > subroutines), and also the coupling between the routines (by reducing > the number of parameters they take). I believe the resulting code is > much simpler - and it is also more general (works for has_many > relations with Select boxes and probably makes less assumptions about > the structure of the form). All tests passed. > > The resulting HTML::FormFu::Model::DBIC is attached - please comment. > > If no one is against it I'll commit it to the svn soon. > > I am planning to add updating relationships to the DBIx::Class update > method - and then base save_to_model on that. This should be another > big code reduction. > > -- > Zbigniew Lukasiak > http://perlalchemy.blogspot.com/ > -- Zbigniew Lukasiak http://brudnopis.blogspot.com/
DBIC.pm
Description: Perl program
_______________________________________________ HTML-FormFu mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
