title: AttributeError: 'function' object has no attribute 'confirmed' with sqlalchemy
body: <p>I'm working to modify a <a href="https://github.com/wdm0006/cookiecutter-flask" rel="nofollow">cookiecutter</a> Flask app. This uses the flask_login usermixin.</p>
  
  <p>I have a method register which contains:</p>
  
  <pre><code>from myflaskapp.models.user import User
  
  if form.validate_on_submit()
      new_user = User.query.filter_by(email=posted_email).first
      if new_user:
          if new_user.confirmed:
  </code></pre>
  
  <p>The posted_email is NOT in the table so I thought that a value of None would be returned. Why is this not working?</p>
  
  <p>myflaskapp.models.user:</p>
  
  <pre><code>from flask.ext.login import UserMixin
  from myflaskapp.extensions import db, bcrypt
  from myflaskapp.database import (
      Column,
      Model,
      ReferenceCol,
      relationship,
      SurrogatePK,
  )
  
  
  
  class User(UserMixin, SurrogatePK, Model):
  
      __tablename__ = 'users'
      username = Column(db.String(80), nullable=True)
      email = Column(db.String(80), nullable=False)
      #: The hashed password
      password = Column(db.String(128), nullable=True)
      created_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
      first_name = Column(db.String(30), nullable=True)
      last_name = Column(db.String(30), nullable=True)
      active = Column(db.Boolean(), default=False)
      admin = Column(db.Boolean(), default=False)
      confirmed = db.Column(db.Boolean, default=False)
      confirmed_on = db.Column(db.DateTime, nullable=True)
  
  &gt;&gt;&gt; User.query.filter_by(email=posted_email).first
  &lt;bound method BaseQuery.first of &lt;flask_sqlalchemy.BaseQuery object at 0x03DF4FF0&gt;&gt;
  &gt;&gt;&gt; User.query.filter_by(email=posted_email)
  &lt;flask_sqlalchemy.BaseQuery object at 0x03DF4030&gt;
  &gt;&gt;&gt; new_user = User.query.filter_by(email=posted_email).first
  &gt;&gt;&gt; type(new_user)
  &lt;type 'instancemethod'&gt;
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\envs\virtalenvs\flask_mini\lib\site-packages\flask_debugtoolbar\__init__.py", line 124, in dispatch_request
    return view_func(**req.view_args)
  File "C:\envs\r2\mini\myflaskapp\views\public.py", line 73, in register
    if new_user.confirmed:
  </code></pre>
  
  <p>AttributeError: 'function' object has no attribute 'confirmed'</p>