title: Flask SQLAlchemy Marshmallow | How do I query all entries between two ID values
body: <p>I want to be able to query a database and <code>jsonify()</code> to results to send over the server.</p>
  <p>My function is supposed to incrementally send <code>x</code> amount of <em>posts</em> every time it called, i.e. <em>Sending posts 1 - 10, ..., Sending posts 31 - 40, ...</em></p>
  <p>I have the following query:</p>
  <pre><code>q = Post.query.filter(Post.column.between(x, x + 10))
  result = posts_schema.dump(q)
  
  return make_response(jsonify(result), 200) // or would it be ...jsonify(result.data), 200)?
  </code></pre>
  <p>Ideally, it would return something like this:</p>
  <pre><code>[
    {
      &quot;id&quot;: 1,
      &quot;title&quot;: &quot;Title&quot;,
      &quot;description&quot;: &quot;A descriptive description.&quot;
    },
    {
      &quot;id&quot;: 2,
      ...
    },
    ...
  ]
  </code></pre>
  <p>The SQLAlchemy model I am using and the Marshmallow schema:</p>
  <pre><code>class Post(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String(30))
      content = db.Column(db.String(150))
  
      def __init__(self, title, description):
          self.title = title
          self.description = description
  
  
  class PostSchema(ma.Schema):
      class Meta:
          fields = ('id', 'title', 'description')
  
  
  posts_schema = PostSchema(many=True)
  </code></pre>
  <p>I am new to <code>SQLAlchemy</code>, so I don't know too much about query yet. Another user had to point me in the direction I am in now with the current query, but I don't think it is quite right.</p>
  <p>In SQL, I am looking to reproduce the following:</p>
  <pre><code>SELECT * FROM Post WHERE id BETWEEN value1 AND value2
  </code></pre>