title: How to pass parameters to django generic views
body: <p>I would like to pass a number to my generic view (DetailView) to get one object Here is my code</p>
  
  <p>Urlpattern</p>
  
  <pre><code>(r'^newreportview/(?P&lt;number&gt;\w+)/$', NewReportView.as_view()),  
  </code></pre>
  
  <p>View Class</p>
  
  <pre><code>class NewReportView(DetailView):
      template_name = "report/newreportview.html"
      context_object_name = "newreportview"
      def get_queryset(self):
          task= get_object_or_404(MyTask,applicationnnumber=self.args[0])
          return task
  </code></pre>
  
  <p>I guess something is wrong  in this line</p>
  
  <pre><code>name = get_object_or_404(MyTask,applicationnnumber=self.args[0])
  </code></pre>
  
  <p>error message:</p>
  
  <pre><code>Exception Type: IndexError
  Exception Value:
  tuple index out of range
  </code></pre>
  
  <p>How should I pass 'number' to this generic view and get a Mytask object with this 'number'?</p>
  
  <p>Thanks</p>