Django URL to View mapping
<p>I have a viewset and some methods in it and getschedule is one of them.</p>

<pre><code>def getschedule(self, request):
</code></pre>

<p>In the urls.py if I map the method getschedule like this </p>

<pre><code>url(r'^event/(?P&lt;pk&gt;[0-9]+)/getschedule/$', EventSingleViewSet.getschedule, name='event-schedule'),
</code></pre>

<p>I get this error <strong><em>"getschedule() missing 1 required positional argument: 'request'
"</em></strong></p>

<p>But if I do the mapping like this, </p>

<pre><code>url(r'^event/(?P&lt;pk&gt;[0-9]+)/getschedule/$', event_getschedule, name='event-schedule'),
......
event_getschedule = EventViewSet.as_view({
    'get': 'getschedule'
}, renderer_classes=[JSONRenderer])
</code></pre>

<p>it works and gives me a response.</p>

<p>I don't understand how the request is getting passed to the method in the second approach. Need help understanding this.</p>

<p>I would also like to know how i could make my first approach work.</p>