On 10/5/06, Ben Bangert <[EMAIL PROTECTED]> wrote:
>
> wyatt-bC wrote:
> > > I went and looked at the source and the problem, if that's what it is,
> > > seems to be on line 963 in base.py:
> > >
> > >         route_options['requirements'] = {'id':'\w+'}
> > >
> > > Would it wreak havoc to allow non-word characters in id, other than
> > > that there might be a conflict with semi-colons and periods?
>
> Probably not with spaces, but it does want to recognize periods and
> semi-colons as not being part of the 'id'. I'll take a look at
> loosening the req on that so a space is ok.
>
> > I thought I had a proposal for this, but then I looked some and
> > realized I don't quite get it.
> >
> > In this list:
> >
> > <snipped example from routes docs>
> >
> > what is the difference between update and edit? How come there's no
> > ;delete? Also, what does new do?
>
> The concept is that doing GET /messages/1;edit will retrieve the screen
> used to edit that entry. For HTML, this means that should return the
> form that you use to edit the entry, while update just updates the
> entry.
>
> These routes are based off Atom Publishing Protocol, which is RESTful
> and the goal of which is to represent your resource and provide a way
> to manipulate it using hte full HTTP verb set. There's no ;delete
> because that's not a representation of a resource, but an action to
> take on the resource. The ;edit is not an action to take, but a
> different representation of the resource.
>
> The ;edit member method is a different representation of the message
> resource, one that is setup for being edited. For example, if you
> wanted a test post, you'd add an additional new member method so that
> you could do:
> POST /messages/1;test   -> messages.test()
>
> Or maybe you want to add a preview option to a new member resource, you
> could. Does that help?

It does make more sense now (and reading the Atom spec and the routes
manual more thoroughly helps too).


> > I was thinking something like this might be good, separating the
> > "parameters" from the main URL, where :id could be anything:
> >
> > /:controller/:id/:action;:format
>
> The resource concept behind RESTful services aims to use the HTTP
> method as the state (action) desired, which is why :action is left off.

I guess "action" is the wrong word. What I was thinking would go in
the action slot would be things like edit, test, preview, etc. I think
what's confusing is that actions map to methods and things like ;edit
also map to methods.


> > Maybe either side of the semi-colon could be blank? This setup would be
> > good for my situation because I wouldn't need the :action;:format at
> > all and could just ignore it.
> >
> > Anyway, these are just some ideas I'm having; maybe I'm off my rocker
> > here...
>
> Cool, keep the ideas flowing. :)
>
> HTH,

That did help, though I'm still hoping there can be a way to separate
:id from the other stuff.


--
Wyatt Baldwin
byCycle.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to