I have a URL pattern mapped to a custom view class in my Django App, like so:
url( r'^run/(?P<pk>\d+)/$', views.PerfRunView.as_view( ))
The problem is, I cannot figure out how I can access 'pk' from the URL pattern string in my view class so that I can retrieve a specific model object based on its database id. I have googled, looked through the Django documentation, searched Stack Overflow, and I can't find a satisfactory answer at all.
Can anybody tell me?