title: "TypeError: filter_by()" error returned in flask when I am trying to use filter_by()
body: <p>I am trying to implement <code>filter_by()</code> function of flask. My issue is, when I am trying to use filter for argument, I got the error of:</p>
  <blockquote>
  <p><code>TypeError: filter_by() takes 1 positional argument but 2 were given</code></p>
  </blockquote>
  <p>I also attached my code to the question.</p>
  <p>Main application source code:</p>
  <pre><code>def login():
      error = None
      form = LoginForm(request.form)
      if request.method == 'POST':
          user = User.query.filter_by(Email=request.form['email']).first()
          password = User.query.filter_by(Password=request.form['password']).first()
          group = User.query.filter_by(user).first()
  
          if user is None or password is None :
              session['logged_in'] = False
              flash('Please write your username password')
          else:
              session['logged_in'] = True
              flash('You were logged in')
              if group==&quot;viewer&quot;:
                  return redirect(url_for('viewer'))
              elif group==&quot;admin&quot;:
                  return redirect(url_for('admin'))
              elif group==&quot;employee&quot;:
                  return redirect(url_for('employee'))
      return render_template('login.html', form=form)
  </code></pre>
  <p>The model which I used for my app :</p>
  <pre><code>class User(db.Model):
      __tablename__ = 'users'
      Id = db.Column(db.Integer, primary_key=True)
      Name = db.Column(db.String(64), index=True, unique=True)
      Email = db.Column(db.String(64), index=True, unique=True)
      Password = db.Column(db.String(128), index=True )
      Group = db.Column(db.String(30))
      Tickets = db.relationship('Request', backref='author', lazy='dynamic')
  </code></pre>
  <p>Login page source code:</p>
  <pre><code>&lt;div class=&quot;innter-form&quot;&gt;
                          &lt;form class=&quot;sa-innate-form&quot; method=&quot;post&quot;&gt;
                              {{ form.csrf_token }}
                              &lt;label&gt;Email Address&lt;/label&gt;
                              &lt;input type=&quot;text&quot; name=&quot;email&quot; value=&quot;{{ request.form.email }}&quot;&gt;
                              &lt;label&gt;Password&lt;/label&gt;
                              &lt;input type=&quot;password&quot; name=&quot;password&quot; value=&quot;{{ request.form.password }}&quot;&gt;
                              &lt;button type=&quot;submit&quot; value=&quot;submit&quot;&gt;Sign In&lt;/button&gt;
                              &lt;a href=&quot;&quot;&gt;Forgot Password?&lt;/a&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
  </code></pre>