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:
>
> GET    /messages         -> messages.index()
> POST   /messages         -> messages.create()
> PUT    /messages/1       -> messages.update(id)
> DELETE /messages/1       -> messages.delete(id)
> GET    /messages/1       -> messages.show(id)
> GET    /messages/1;edit  -> messages.edit(id)
>
> 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?

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

> 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,
Ben


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