title: (Django Rest Framework) How to add backward URL field?
body: <p>I'm using drf-nested-routers. Parameter and Location are connected by _location foreign key. Inside Parameter, I want to add a Location field that points to its Location. I think what I need is a backward url link? How could I achieve this?</p>
  <p>model</p>
  <pre><code>class Location(models.Model):
      name = models.CharField(max_length=25, unique=True)
      description = models.CharField(max_length=64, blank=True)
      longitude = models.FloatField(blank=True, null=True)
      latitude = models.FloatField(blank=True, null=True)
  
      class Meta:
          verbose_name_plural = 'locations'
  
      def __str__(self):
          return self.name
  
  class Parameter(models.Model):
      name = models.CharField(max_length=25)
      unit = models.CharField(max_length=10, blank=True)
      values = models.JSONField(default=list, blank=True)
      _location = models.ForeignKey(Location, 
                                  on_delete=models.CASCADE, 
                                  related_name=&quot;parameters&quot;
                  )
      def __str__(self):
          return self.name
  </code></pre>
  <p>serializer</p>
  <pre><code>class ParameterSerializer(serializers.ModelSerializer):
      aggregation = serializers.SerializerMethodField()
      #I want to add the location url here
      location = 
      class Meta:
          model = Parameter
          fields = ('id', 'name', 'unit', 'aggregation', 'location', 'values')
      
      def get_aggregation(self, obj):
          return aggregate(obj.values)
      def create(self, obj):
          return add_parameter(obj)
  
  class LocationSerializer(serializers.ModelSerializer):
      parameters = serializers.HyperlinkedIdentityField(view_name='weather:location-parameters-list', lookup_url_kwarg='location_pk')
      aggregation = serializers.JSONField(default=dict, source=&quot;parameters.aggregation&quot;, allow_null=True)
      class Meta:
          model = Location
          fields = ('id','name', 'description','longitude', 'latitude', 'aggregation', 'parameters')
      def create(self, obj):
          return add_location(obj)
  
  </code></pre>
  <p>urls.py</p>
  <pre><code>app_name = &quot;weather&quot;
  
  router = routers.SimpleRouter()
  router.register('locations', LocationViewSet)
  
  locations_router = routers.NestedSimpleRouter(router, 'locations', lookup='location')
  locations_router.register('parameters', ParameterViewSet, basename='location-parameters')
  
  urlpatterns = [
      path(&quot;&quot;, include(router.urls)),
      path(&quot;&quot;, include(locations_router.urls))
  ]
  </code></pre>