A while back I was given the advice to not use the GET approach in my urls when using Django as it’s cleaner this way.
That works pretty nice with one parameter:
(r'^call/add/(?P<call_id>\d+)/$', call_view),
http://127.0.0.1:8000/call/add/1/
But how could I possibly use the same approach with two parameters?
As I am still learning, please enlighten me about better approaches. Thank you.
You simply can add another on the back like
http://127.0.0.1:8000/call/add/1/foo/2. You have to add the second parameter to the regular expression as well like(r'^call/add/(?P<call_id>\d+)/foo/(?P<foo_id>\d+)$', call_view),.You have to change the controller as well:
def call_view(request, call_id, foo_id):