title: Finding a model instance by string in Django
body: <p>I have a function now to find a model instance based on matching the string which the model returns. This is obviously not efficient. I was wondering if Django has a method to find a model instance based only on the string rather than by filtering by the instance attributes.</p>
  
  <pre><code>def parse_book(book_name):
      for book in Book.objects.all():
          if str(book) == book_name:
              return book
  </code></pre>