title: Accessing values stored in a Field and comparing it with other parameter in serializer
body: <p>This is what i have in Django Author model as a primary key
  <code>id = models.URLField(primary_key=True)</code>
  One example can be {id:&quot;http://localhost:3000/authors/1d698d25ff008f7538453c120f581471&quot;}.
  In My serializer, i want to compare <code>1d698d25ff008f7538453c120f581471</code> portion of the path to an author_id i passed in. Right now, I am using,</p>
  <pre><code>from urllib.parse import urlparse
  ...
  def create(self, validated_data, author_id):
          author, created = Author.objects.update_or_create(
              urlparse(id).path.split('/')[2]=author_id, defaults=validated_data)
          return author
  </code></pre>
  <p>Is there an alternative of doing this?</p>