Thanks Malcolm and Rob.The idea of calling get_myresource() at the end of post_myresource() makes a lot of sense in case POST needs to return the representation of the new resource. For some objects it may not be practical or desirable (heavy objects, complex queries, performance-sensitive APIs). S
> What is the best way to dispatch to a method based on both HTTP method *and*
> a URL?
Basically you've found it, and it is a clean way to code. However you
have to consider calling get_myresource() from post_myresource(), as
you would probably do if the POST has errors. Typically manipulators
On Mon, 2006-04-24 at 01:23 +, Alexis Smirnov wrote:
> Some of the URLs in my django application are addressable by both POST
> and GET requests. This results in the code like this:
>
> urls.py:
>
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
> (r'^myapp/myres
Some of the URLs in my django application are addressable by both POST
and GET requests. This results in the code like this:
urls.py:
from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^myapp/myresource/$', 'myproj.myapp.myresource'),
views.py:
...
def myresourc