title: sqlalchemy, violation foreign key constraint
body: <p>I am new to sqlalchemy. I want to create a class which has two foreign key for different tables. Why I get next error?</p>
  
  <pre><code>sqlalchemy.exc.IntegrityError: (IntegrityError) insert or update on table "event" violates foreign key constraint "event_user_fkey"
  DETAIL:  Key (user)=(U) is not present in table "user".
   'INSERT INTO event (id, "user", item) VALUES (%(id)s, %(user)s, %(item)s)' {'item': 'I', 'user': 'U', 'id': 'E'}
  </code></pre>
  
  <p>My code is next:</p>
  
  <pre><code>class User(Base):
      __tablename__ = 'user'
      id = Column(String, primary_key=True)
  
      def __init__(self, id):
          self.id = id
  
  class Item(Base):
      __tablename__ = 'item'
      id = Column(String, primary_key=True)
  
      def __init__(self, id):
          self.id = id
  
  class Event(Base):
      __tablename__ = 'event'
      id = Column(String, primary_key=True)
      user = Column(String, ForeignKey('user.id'))
      item = Column(String, ForeignKey('item.id'))
  
      def __init__(self, id, user_id, item_id):
          self.id = id
          self.user = user_id
          self.item = item_id
  </code></pre>
  
  <p>I use postgresql as a back end.</p>
  
  <pre><code>Base.metadata.create_all(engine)
  Session = sessionmaker(bind=engine)
  session = Session()
  usr = User('U')
  it = Item('I')
  event = Event('E', usr.id, it.id)
  session.add(usr)
  session.add(it)
  session.add(event)
  </code></pre>