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

Jonas Alves jonas.alves at gmail.com
Thu Oct 18 18:11:45 GMT 2007


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.

Cheers,
-- =

Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071018/f3=
7beb75/attachment.htm


More information about the HTML-FormFu mailing list