-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I keep bumping up against this issue...

Routes documentation
====================

POST   /messages        => messages.create()   => url("messages")
PUT    /messages/1      => messages.update(id) => url("message", id=1)

routes/middleware.py
====================

#90         if old_method:
#91             environ['REQUEST_METHOD'] = old_method


config/routing.py
=================
    ...
    map.resource('thing', 'things')
    ...

controllers/mycontroller.py
===========================
@rest.restrict('PUT')
def update(self, id):
    """PUT /things/id: Update an existing item."""

forms/myform.py
===============
class ThingForm(twf.ListForm):
    rest_method = twf.HiddenField(
        value = "PUT", name = "_method")

log.debug
=========
_method found in POST data, altering request method to PUT
...
REQUEST_METHOD = PUT
Have old_method of POST, restoring.
Before: REQUEST_METHOD = PUT
After: REQUEST_METHOD = POST
old_method restored to environ['REQUEST_METHOD'] (now = POST).
...
Matched POST /things/1
...
Route path: '/things/:(id)', defaults: {'action': u'update', 'controller': u'things'}
...
Calling 'update' method with keyword args: **{'id': u'1'}
...
Method not allowed by restrict

Quoi?

What is the erstwhile purpose of restoring the old method?

- --
Cheers,

Graham

http://www.linkedin.com/in/ghiggins





-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAkyvXdsACgkQOsmLt1Nhivy2JwCfWUQhgIXcNODdlcFIXhVaJ9y1
G1MAoNIQcHcbPUzbx1XnT9mWTTh1RpCoiQCVAgUBTK9d21nrWVZ7aXD1AQJcKAP8
DzwkbeXOc0FSM9LlFWcCPLk0Ul2KUjIUL3kEozr4vVSUv8EAidxYW3BrPIzt8B3L
W/aHeMHbWFOUWA2W/Q616H55dVrd6PiuA/245Z8mAHNSl/ybqJHiowQzHRyqWUgx
iF6V3PaOyBQgTUCkIc8aI6/n3hwPEIj5T99onho1uf0=
=OEdh
-----END PGP SIGNATURE-----

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