Sean Cazzell wrote:
> Ian in which cases would you recommend the use of the coercers then?  I
> understand you are saying "for passing information back that came from
> the server".
> 
> I was using them in Wareweb (just experimenting) with URLs like:
> 
> /viewdoc/43/
> 
> @public
> @unpack
> def viewdoc(self, doc_id_int):
>   .. do something ..
> 
> Obviously, doc_id_int is supplied by the user on the URL not from the
> server - am I not using things in the intended way here?

I mean, the user really typed it in.  The user *can* go and edit the
URLs themselves, but I expect them not to, so this would be fine.  If
they get it wrong in this example you aren't going to say "'r3' is not a
number, please enter the article id you intended: <input...>", you'll
just give them a 404 or 400 or some response like that.  But if it's a
registration form, you shouldn't use unpack() when you ask for their age.

So by "server generated" I mean anything you put in a link href, a
hidden input field, or a constrained field like selects or checkboxes.


-- 
Ian Bicking  |  [EMAIL PROTECTED]  |  http://blog.ianbicking.org

Reply via email to