title: Django - Append Path to get_absolute_url
body: <p>Is it possible to append path to <code>get_absolute_url</code>? For instance, I want to append <code>/credentials/</code> to the following code so the final output would be something like <code> /api/v2/job_templates/9/credentials/&quot;,</code></p>
  <pre><code>    if obj.unified_job_template:
          res['unified_job_template'] = obj.unified_job_template.get_absolute_url(self.context.get('request'))
  </code></pre>
  <p>This is what it looks like at the moment..</p>
  <p><a href="https://i.stack.imgur.com/dTsIB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dTsIB.png" alt="enter image description here" /></a></p>
  <p>Here is the full code:</p>
  <pre><code>def get_url(self, obj):
      if obj is None or not hasattr(obj, 'get_absolute_url'):
          return ''
      elif isinstance(obj, User):
          return self.reverse('api:user_detail', kwargs={'pk': obj.pk})
      else:
          return obj.get_absolute_url(request=self.context.get('request'))
  
  def get_absolute_url(self, request=None):
      return reverse('api:unified_job_template', kwargs={'pk': self.pk}, request=request)
  
  
  
  class WorkflowJobTemplateNodeSerializer(LaunchConfigurationBaseSerializer):
      success_nodes = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
      failure_nodes = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
      always_nodes = serializers.PrimaryKeyRelatedField(many=True, read_only=True)
      exclude_errors = ('required',)  # required variables may be provided by WFJT or on launch
  
      credentials = serializers.PrimaryKeyRelatedField(
          many=True, queryset=Credential.objects.all(),
          required=False, write_only=True
      )    
  
      class Meta:
          model = WorkflowJobTemplateNode
          fields = ('*', 'workflow_job_template', '-name', '-description', 'id', 'url', 'related',
                    'unified_job_template', 'success_nodes', 'failure_nodes', 'credentials', 'always_nodes', 'all_parents_must_converge',
                    'identifier')
  
      def get_related(self, obj):
          res = super(WorkflowJobTemplateNodeSerializer, self).get_related(obj)
          res['create_approval_template'] = self.reverse('api:workflow_job_template_node_create_approval', kwargs={'pk': obj.pk})
          res['success_nodes'] = self.reverse('api:workflow_job_template_node_success_nodes_list', kwargs={'pk': obj.pk})
          res['failure_nodes'] = self.reverse('api:workflow_job_template_node_failure_nodes_list', kwargs={'pk': obj.pk})
          res['always_nodes'] = self.reverse('api:workflow_job_template_node_always_nodes_list', kwargs={'pk': obj.pk})        
  
          if obj.unified_job_template:
              res['unified_job_template'] = obj.unified_job_template.get_absolute_url(self.context.get('request'))
          try:
              res['workflow_job_template'] = self.reverse('api:workflow_job_template_detail', kwargs={'pk': obj.workflow_job_template.pk})
          except WorkflowJobTemplate.DoesNotExist:
              pass
          return res
  
      def build_relational_field(self, field_name, relation_info):
          field_class, field_kwargs = super(WorkflowJobTemplateNodeSerializer, self).build_relational_field(field_name, relation_info)
          # workflow_job_template is read-only unless creating a new node.
          if self.instance and field_name == 'workflow_job_template':
              field_kwargs['read_only'] = True
              field_kwargs.pop('queryset', None)
          return field_class, field_kwargs
  
      def get_summary_fields(self, obj):
          summary_fields = super(WorkflowJobTemplateNodeSerializer, self).get_summary_fields(obj)
  
          if isinstance(obj.unified_job_template, WorkflowApprovalTemplate):
              summary_fields['unified_job_template']['timeout'] = obj.unified_job_template.timeout
          return summary_fields
  </code></pre>