Anthony is right. That comment makes little sense in that context.

On Monday, 23 July 2012 15:16:29 UTC-5, Anthony wrote:
>
> In a previous edition of the book, that view example included the 
> following:
>
> {{=db().select(db.person.ALL)}}
>
> I believe the note was referring to that usage of the db object in the 
> view. I have removed the note, as the view has been updated since then and 
> no longer refers directly to the db object.
>
> I assume the doc means that validators shouldn't be used in a model file, 
>> as the formatting that gets done as a result should be done by the view.
>>
>
> I don't think this is really an issue. The validators don't really do any 
> formatting/presenting of the data, though in some cases they transform the 
> data (which I think is properly the role of the model). The "represent" 
> attibute of a field, on the other hand, can sometimes straddle the line 
> between mere data transformation and actual formatting/presentation -- but 
> even then, it may still make sense to keep these in the model because they 
> will apply to all places where the field is represented, keeping the code 
> DRY.
>
> Anthony
>

-- 



Reply via email to