Theoretically, Restler will handle nested resources (beyond a single
nesting, which it already supports well). It should just be a matter
of setting up the right routes (and maybe a bit of hacking). It would
be nice if we could figure this out in one place instead of a bunch of
different people hacking on what seems to be basically the same thing.

Is it just a matter of what's showing in the address bar? Or, do you
need access to the grandparent (great-grandparent, etc) in the
controller? I've found that with navigation, you can get where you
need to go without adding extra complexity to the controller. On the
other hand, I might like to see the full nesting in the URL bar. And
there must be use cases (such as yours) where it's more than just a
matter of what's in the address bar.

If you can tell me more about what you're trying to do, I might be
able to figure out if I can get Restler to support it.


As far as the templates, they're in Restler/restler/templates/
defaults. DELETE isn't in there anywhere, but it looks like this:

${h. button_to(controller='mycontroller', id=12, action='delete'),
method='DELETE')}

And PUT:

${h.form(h.url_for(controller='mycontroller', id=12, action='update'),
method='PUT')}
    <fields>
${h.end_form()}

__wyatt


On Apr 27, 6:47 pm, "Gregory W. Bond" <[EMAIL PROTECTED]> wrote:
> i looked at restler but unfortunately it doesn't meet my requirements
> (namely, nested resources, as shown in one of my posts in this thread)
> - i also took a look at the restler source but i couldn't figure out
> how you were handling DELETE/PUT in your templates (i'm still new to
> this pylons thing :-) )
>
> On Apr 27, 4:13 pm, __wyatt <[EMAIL PROTECTED]> wrote:
>
> > On Apr 27, 11:48 am, "Gregory W. Bond" <[EMAIL PROTECTED]> wrote:
>
> > > i'm trying to implement a RESTful Pylons controller and i can't figure
> > > out how to support client-side DELETE and PUT requests - the only
> > > suggestions i can find in the context of Pylons are
>
> > >http://pylonshq.com/pasties/12
>
> > > and
>
> > >http://groups.google.com/group/pylons-discuss/browse_frm/thread/3463c...
>
> > > (both from Ben)
>
> > > here's an example of this approach for a client side DELETE request
>
> > > # Forms posted to this method should contain a hidden field:
> > > #    <input type="hidden" name="_method" value="DELETE" />
> > > # Or using helpers:
> > > #    h.form(h.url_for('${singularname}', id=ID), method='delete')
>
> > > the aforementioned approach doesn't actually use DELETE and PUT
> > > requests - instead it uses hidden form fields - why? is there no
> > > support for DELETE/PUT in the Pylons webhelpers?
>
> > It's not about the webhelpers, it's about browser support. They don't
> > all know about DELETE and PUT, so POST is used with the hidden field
> > for compatibility.
>
> > > secondly, it looks like the RESTful extensions to Routes (http://
> > > routes.groovie.org/manual.html#restful-services) can't be used with
> > > this approach since they are expect true http PUT/DELETE requests so
> > > what should the Routes config look like for this approach?
>
> > map.resource does work with the hidden form field approach.
>
> > Instead of implementing your own RESTful controller, you might want to
> > check this out:
>
> >http://code.google.com/p/restler/
>
> > Even if you don't use it, it might be a useful reference. There's an
> > example app that shows how to use it (MyProject). It also includes
> > templates that use the hidden field approach.
>
> > __wyatt


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to