On 1/11/06, Randall <[EMAIL PROTECTED]> wrote: > I've seen a suggestion against using the data model's FormEncode > validator as the widget validator. Why would this be a bad idea? A > validator that worked with both the model and view would avoid > duplication and make CRUD interfaces richer.
I'm using TG to front a legacy DB. The fields in the DB are restricted to ints and fixed width char fields. Needless to say, the database doesn't necessarily express the semantic richness of the model. About 25% of the attributes of my sqlobject model don't correspond directly to a field in the database. By doing this, I get a consistent, meaningful model whose complexity is self contained. If I were to share validators with the forms, I would be leaking my abstractions from my model. I could do some of them through custom column types, but I'm not sure if mapping one attribute onto multiple database columns is doable at the column level.

