title: passing model attributes to URL in Django
body: <p>I am new to Django. I have a model with 2 fields called id (as pk) and region.I have a page to return objects in each region.There are 10 regions and I need to pass region number to url to retrieve data from db filtering that region.
  Here is my code :</p>
  <p><strong>views.py</strong></p>
  <pre><code>def render_pdf_view(request, *args, **kwargs):
  pk = kwargs.get('pk')   *********here i need to get region from clicked button instead of pk*************
  data = MyModel.objects.filter(region=pk)
  template_path = 'pdf/Pdf.html'
  context = {'data':data}
  return response
  </code></pre>
  <p><strong>urls.py</strong></p>
  <pre><code>path('pdf/&lt;pk&gt;/', render_pdf_view, name='pdf-data') ***I need to pass region instead of pk***
  </code></pre>
  <p><strong>template</strong></p>
  <pre><code>&lt;a href=&quot;{% url 'application : pdf-data' ? %}&quot;&gt; export pdf &lt;/a&gt; 
  </code></pre>
  <p>I don't know how to pass the region from clicked button to view and then pass it to url.
  Any help would be appreciated.</p>