title: Getting objects with the same values (Flask)
body: <p>I am new to Flask.
  I have a database and I want to extract comments from it with the same parent ID and put them in the &quot;comments&quot; variable. How should I do it?
  Comments DB model class:</p>
  <pre><code>class Comment(db.Model):
  __tablename__ = 'comments'
  id = db.Column(db.Integer(), primary_key=True)
  parent_id = db.Column(db.Integer(), nullable=False)
  author = db.Column(db.String(100), nullable=False)
  comment = db.Column(db.Text, nullable=False)
  
  def __repr__(self):
      return f&quot;&lt;{self.id}&gt;&quot;
  </code></pre>
  <p>EDIT: parent_id is ID of arcticle.</p>