title: TypeError: remove() takes 1 positional argument but 2 were given
body: <p>I'm developing a Python app with flask and this is my DELETE function:</p>
  
  <pre><code>@app.route('/DeleteMessage', methods=['GET'])
  def DeleteMessage():
      global messages
      application_id = request.args.get('application_id')
      if application_id:
          messages = Message.query.filter_by(user_id=application_id)
      session_id = request.args.get('session_id')
      if session_id:
          messages = Message.query.filter_by(session_id=session_id)    
      message_id = request.args.get('message_id')
      if message_id:
          messages = Message.query.filter_by(message_id=message_id)
  
      for m in messages:  
          db.session.remove(m)
          db.session.commit()
      return 'Message deleted successfully!'
  </code></pre>
  
  <p>It sends me such an error message:</p>
  
  <pre><code>TypeError: remove() takes 1 positional argument but 2 were given
  </code></pre>
  
  <p>What is the problem?</p>