title: How to insert data to postgresql database with flask - sqlalchemy.exc.ProgrammingError?
body: <p>I would like to insert data to postgresql database with flask.</p>
  
  <p>This is a model class code that I wrote.</p>
  
  <pre><code>class Bet365(db.Model):
      __tablename__ = "bet365s"
      id = db.Column(db.Integer, primary_key=True)
      sports = db.Column(db.Float)
      casino = db.Column(db.Float)
      poker = db.Column(db.Float)
      games_bingo = db.Column(db.Float)
      total = db.Column(db.Float)
      withdrawal = db.Column(db.Float)
      balance = db.Column(db.Float)
  
      def __init__(self, sports, casino, poker, games_bingo, total, withdrawal, balance):
          self.id = id
          self.sports = sports
          self.casino = casino
          self.poker = poker
          self.games_bingo = games_bingo
          self.total = total
          self.withdrawal = withdrawal
          self.balance = balance
  </code></pre>
  
  <p>This is the snippet code which is responsible for inserting data.</p>
  
  <pre><code>@app.route('/testing/')
  def testing():
      data_bet365 = bet365_scrapping()
  
      sports = float(data_bet365[0])
      casino = float(data_bet365[1])
      poker = float(data_bet365[2])
      games_bingo = float(data_bet365[3])
      total = float(data_bet365[4])
      withdrawal = float(data_bet365[5])
      balance = float(data_bet365[6])
  
      result_bet365 = Bet365(sports, casino, poker, games_bingo, total, withdrawal, balance)
      db.session.add(result_bet365)
      db.session.commit()
      return (jsonify(data_bet365))
  </code></pre>
  
  <p>When I run this script, I get an error like this.</p>
  
  <pre><code>sqlalchemy.exc.ProgrammingError
  
  sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'builtin_function_or_method'
  [SQL: 'INSERT INTO bet365s (id, sports, casino, poker, games_bingo, total, withdrawal, balance) VALUES (%(id)s, %(sports)s, %(casino)s, %(poker)s, %(games_bingo)s, %(total)s, %(withdrawal)s, %(balance)s)']
  [parameters: {'withdrawal': 0.0, 'id': &lt;built-in function id&gt;, 'sports': -29.94, 'total': 593.75, 'casino': 464.22, 'poker': 14.29, 'games_bingo': 145.17, 'balance': 593.75}]
  </code></pre>
  
  <p>I can't find a solution. Please help me.</p>