personally, i keep anything that could hit the database away from formencode
i use formencode to validate presence and formatting / regex, and keep the db logic within a try/except block. if i have an error, i'll raise a SubmissionError - or similar - and then return the form. i do this for a few reasons: a_ i find fancy validation schemes to be a (*((*...@## (*...@# ))@# and generally not worth time doing b_ i find putting db logic and advanced stuff in the main controller record to be much much easier c_ i dont want to touch the db unless the form content is valid. nearly every form i use would need a WRITE handle on the database. a precious, precious, write handle. i don't like tying up a write handle when not needed, nor do i like the idea of locking tables on something that is more likely to fail (than other operations). i could go on, but you get my point ;) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
