title: how to get url parameter in modelform
body: <p>I have one model name is cityform</p>
  
  <p>i want to get url parmeter in this CityFrom hwo can i do this?</p>
  
  <p>here is my url </p>
  
  <pre><code>path('state/city/&lt;int:id&gt;/', City.as_view(), name="city")
  </code></pre>
  
  <p><a href="http://localhost:8000/country/state/city/3/" rel="nofollow noreferrer">http://localhost:8000/country/state/city/3/</a></p>
  
  <p>here is my form </p>
  
  <p>class </p>
  
  <pre><code>CityFrom(forms.ModelForm):
      def __init__(self, *args, **kwargs):
  
          super(CityFrom,self).__init__(*args, **kwargs)
          print(args)
          print(kwargs)
  
          self.fields['state'] = forms.ModelChoiceField(
                                   empty_label = 'Select',
                                   queryset = State.objects.all()
                                  ) 
      class Meta:
          model = City
          fields = ('state', 'name')
  </code></pre>
  
  <p>in this form i want to access id  = 3</p>
  
  <p>here is my view</p>
  
  <pre><code>from django.views import View
  class City(View):
      def get(self, request, *args, **kwargs):
          Forms = CityFrom()
          return render(request, 'albums/add.html', {'Forms': Forms})
  </code></pre>