title: Sqalchemy postgres: AttributeError: can't set attribute
body: <p>When initializing my postgres database with sqalchemy, I am getting an AttributeError: can't set attribute error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "manage.py", line 567, in &lt;module&gt;
      manager.run()
    File "/usr/local/lib/python3.6/site-packages/flask_script/__init__.py", line 417, in run
      result = self.handle(argv[0], argv[1:])
    File "/usr/local/lib/python3.6/site-packages/flask_script/__init__.py", line 386, in handle
      res = handle(*args, **config)
    File "/usr/local/lib/python3.6/site-packages/flask_script/commands.py", line 216, in __call__
      return self.run(*args, **kwargs)
    File "manage.py", line 26, in initdb
      password="passwo",
    File "&lt;string&gt;", line 4, in __init__
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 417, in _initialize_instance
      manager.dispatch.init_failure(self, args, kwargs)
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
      compat.reraise(exc_type, exc_value, exc_tb)
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
      raise value
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/state.py", line 414, in _initialize_instance
      return manager.original_init(*mixed[1:], **kwargs)
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/ext/declarative/base.py", line 700, in _declarative_constructor
      setattr(self, k, kwargs[k])
    File "/usr/local/lib/python3.6/site-packages/sqlalchemy/ext/hybrid.py", line 873, in __set__
      raise AttributeError("can't set attribute") AttributeError: can't set attribute
  </code></pre>
  
  <p>The table is defined like this:</p>
  
  <pre><code>class User(db.Model, UserMixin):
      """
      A user who has an account on the website.
      """
  
      __tablename__ = 'user'
  
      id = db.Column(db.Integer,
                     primary_key=True,
                     nullable=False,
                     unique=True,
                     autoincrement=True)
      first_name = db.Column(db.String)
      last_name = db.Column(db.String)
      phone = db.Column(db.String)
      email = db.Column(db.String, unique=True)
      photo = db.Column(db.String, default="No Picture")
      _password = db.Column(db.Binary(60))
  </code></pre>
  
  <p>and initialized like this:</p>
  
  <pre><code>def initdb():
      ''' Create the SQL database. '''
      db.create_all()
      print(colored('The SQL database has been created', 'green'))
  
      user2 = models.User(
          first_name="Jane",
          last_name="Doe",
          phone="123",
          email="test@test.test",
          password="passwo",
      )
      db.session.add(user2)
  </code></pre>
  
  <p>How can I initialize the database correctly?</p>
  
  <p><strong>UPDATE 1:</strong> I downgraded my SQLAlchemy from 1.2.5 to 1.1.15 (following the suggestion in <a href="https://github.com/puckel/docker-airflow/issues/160" rel="nofollow noreferrer">https://github.com/puckel/docker-airflow/issues/160</a> and the error disappears. Is there a way to circumvent the error in 1.2.5?</p>