title: SQLAlchemy can't adapt type "builtin_function_or_method"
body: <p>I am using Celery with Flask and SQLAlchemy to store some strings into the database. Everything works fine but when I created the database class:</p>
  
  <pre><code>class Locations(db.Model):
      id = db.Column('id', db.Integer, primary_key=True)
      data = db.Column('data', db.String(50))
  
  def insert():
      location="Madrid"
      l = Locations(id=id, data=location)
      db.session.add(l)
      db.session.commit()
  </code></pre>
  
  <p>And when I access a url page is invokes the method insert(), I get this error, which I assume has something to do with id:</p>
  
  <pre><code>sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'builtin_function_or_method' [SQL: 'INSERT INTO locations (id, data) VALUES (%(id)s, %(data)s)'] [parameters: {'id': &lt;built-in function id&gt;, 'data': 'Oslo'}] (Background on this error at: http://sqlalche.me/e/f405)
  </code></pre>