[Catalyst] Form validation in insert() and update()?

Christopher H. Laco claco at chrislaco.com
Tue May 15 19:51:18 GMT 2007


> where do you handle the validation? Only in the controller or in
> both the model and controller?

Fail Early. Fail Often.

Some will say redundancy sucks. I agree, except for where validation is
concerned. If you're writing data from the web into a model, check the
data at the page level, and at the model level.

If you're writing to a model from a command line utility...check data at
the command line level, and the model level...

The trick is to define those check in a way that can be used in both
places....


>=20
> Could you give a short example of taking an actual field from the
> request parameters, validating it, and updating a row with it?
>=20
> Thanks,
>=20
> Maurice
>=20
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.=
org/
> Dev site: http://dev.catalyst.perl.org/
>=20
>=20


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070515/4bb7c0f5/signature.pgp


More information about the Catalyst mailing list