iain duncan schrieb:
> '//domain/news' holds all the news related methods with:
> 
> news - view all news artilces
> news/1 - view article 1
> news/1/edit - get form for news 1
> news/0/new  or news/new - make new news item
> /news/1/delete - kill it

Yes, that's the classic rest URL layout, for which you will need a
"default" method that does the dispatching. But it saves you from having
to put the object id as a hidden field in every form.

Only the "news/0/new" URL is ugly, I would do it as you say below.

> Also, what do others think of having the crud from submit back to the
> same method that generated the form? Remi Jolin's example solved a bunch
> of validation problems for me by having
> 
> news/1 
> 
> receive the results of the news form for item 1 and decide what to do
> based on presence of POST vars or not. 

Exactly what I do. Also you can have the URL "/news/" distinguish
between GET and POST. If it's a GET, show the list of objects, if it's a
POST, a new object is created.

Handling all this in a "default" controller method is a bit messy, it
would be nice to have an expose decorator that can distinguish between
different HTTP methods like it is discussed for TG 2.0 at the moment (or
was it 1.1.?).

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to