On Fri, 2007-29-06 at 23:24 +0200, Christopher Arndt wrote:
> 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.

So, what url would you use for requesting a form for a new piece? 
The asymmetry of news/1/edit and news/new seems weird to me, as the verb
arg is changing position.

Me, I'm still confused as to news/edit/1 vs news/1/edit. I'm reading the
book, but it takes a long and winding rout to the meat of the matter! ;)

> 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.

Ok, that sounds cool.

> 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.?).

I was thinking each object would be a subcontroller, in that if I am
building a custom cms for someone, they might want news, blog, products,
gallery, etc. So if the name of the abstract resource is at the top,
that can just be a subcontroller that gets dropped into the project and
the project can import everything in the subcontrollers directories.
Thoughts on that?

Iain



--~--~---------~--~----~------------~-------~--~----~
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