iain duncan schrieb: > On Fri, 2007-29-06 at 23:24 +0200, Christopher Arndt wrote: >> 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.
That's a point I haven't consistently decided for myself yet either. Generally there are two approaches: a) make "/news/" also display the form for editing the item b) display the form with an extra controller method. You can combine a) with some AJAX-foo to load the form only when the user clicks on some "Add new item" link. For b) "/news/new" or "/news/add" seem appropriate. Both a) and be then > 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! ;) What's confusing there? These are just different conventions. The first makes the form easier, because the id is already in the URL and you don't need a hidden field, the second maps directly to the CherryPy dispatch mechanism. To make this clearer, maybe it helps to show some code. This doesn't distinguish between GET/POST for "/news/?/edit" though, it uses an "update" method to save form submissions (I may have posted this code already some time ago). http://paste.turbogears.org/paste/1452 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 -~----------~----~----~----~------~----~------~--~---

