[html-formfu] DBIC::Validation::FormFu RFC & Element::Date patch

Jonas Alves jonas.alves at gmail.com
Fri Oct 19 12:21:08 GMT 2007


On 19/10/2007, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
>
> On 10/18/07, Jonas Alves <jonas.alves at gmail.com> wrote:
> >
> >
> > On 18/10/2007, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
> > > Hi Jonas,
> > >
> > > How about moving the the validation from the DB layer code into some
> > > separate class in HTML::FormFu hierarchy?  I hate it when I have to
> > > add things to the DB model that belong to the form layer this makes
> > > the model coupled to the form - and I would rather have a clean model
> > > independend on what form processing layer I use.
> > >
> > > Cheers,
> > > Zbyszek
> > >
> > >
> >
> > Hi Zby,
> > I don't know if I got it, but if you don't want the model and the form
> layer
> > coupled then you don't need to do anything. Just validate with FormFu or
> > your preferred validator first and then insert in the database like you
> > usually do.
> > On the other hand if you don't bother that they are coupled, you just
> need
> > to call create or update on your resultset and the data is validated
> before
> > being inserted. An exception with the form will be thrown if the data is
> not
> > valid.
>
> Ah - I thought you wrote the code to load the constraints from the
> database - like the length of the varchars - and check it.
>

Might wrote that too. But I thing that a better approach for that is to
write a SQLT::Producer::HTML::FormFu. That way you can get a FormFu config
from DBIC, from your DB directly, or from any other SQLT::Parser that
exists. I will work on that. :)

-- =

Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071019/02=
639006/attachment.htm


More information about the HTML-FormFu mailing list