title: response in list form: FastAPI
body: <pre class="lang-py prettyprint-override"><code>@app.get(&quot;/{subject}&quot;)
  def getResult(subject:str, db:Session = Depends(get_db):
      quesnQuery = db.query(models.Post).filter(
          func.lower(models.Post.category) == func.lower(subject)
      ).order_by(func.random())
      quesn = quesnQuery.limit(10).all()
      return quesn
  </code></pre>
  <p>For code above I am getting the response in following form</p>
  <pre><code>0:[]
  </code></pre>
  <p>But I want the return statement to be in following format</p>
  <pre><code>response:[{},{},{},{},{}]
  </code></pre>
  <p>I am unable to achieve the desired response format.
  Is there a way to do so...</p>