--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog
For the RestController (which might be out of scope for the sprint), would
it be possible to do (something like) this, using the wonderful dynamicness
of python?
def Person
http get:
do some code here
return dict1
http post:
do some other code here
return dict2
http put:
do some other code here
return dict3
http put:
do stil other code here
return dict4
This would basically encapsulate the concept that Mark showed me yesterday
(ask him about it.) Of course the HTTP part would need to accept
decorators...
Also, how do we explicitly return an HTTP status code. In REST development
status codes control interactions and those should be front and center.
Frankly I'd like to see something like this:
return (status, dict)
So it is obvious, such as:
return (200, dict_with_content_data)
return (404, dict_with_error_info)
That may be very un-TG and hence out of consideration, but I thought I'd
propose. Oh, and HTTP headers are the other thing that is very often
modified, so here's a thought:
return (status, http_headers, dict)
Lastly, some things like cache control headers and eTags really should have
special handling in the controller. See the RESTful book on those subjects.
--
-Mike Schinkel
http://www.mikeschinkel.com/blogs/
http://www.welldesignedurls.org
http://atlanta-web.org - http://t.oolicio.us
P.S. I'm sending this email then leaving home. I will have my mobile, but
otherwise almost no access to email today.