title: Proper way to call a database function from Django?
body: <p>i'm triyng to make a full text search with postgresql and django So I've created a function <code>search_client(text)</code> which returns a list of clients. To call it from the DB i use something like this:</p>
  
  <pre><code>SELECT * FROM search_client('something')
  </code></pre>
  
  <p>and i'm not really sure how to call it from django. i know i could do something like</p>
  
  <pre><code>cursor = connection.cursor()
  cursor.execute("SELECT * FROM search_client('something')")
  result = cursor.fetchall()
  </code></pre>
  
  <p>but that will only return a list of values, and i'd like to have a list of objects, like when i use the "filter()" method.</p>
  
  <p>Any ideas?? thanks for your time!</p>