title: Python/SQLAlchemy not updating instances with list of tuples
body: <p>I've been learning to use SQLAlchemy and am trying to get it to load data already in the database, change values of the objects by adding a tuple to a list, then save/update them in the database.</p>
  
  <p>For some reason, when I append a tuple to an attribute that is a list of tuples, the updater of SQLAlchemy ignores it. Using Session.dirty and re-querying the database shows no change has happened to that value.</p>
  
  <p>How do I create or update an object attribute that is a list of tuples so that the database is updated, too?</p>
  
  <p>Here's the code for the database:</p>
  
  <pre><code>class SQLAlchemyDatabase():
  
      def __init__(self, DBDirectory, ThisDatabaseName, Report=False):
          ''' Creating the database by path and name given '''
  
          self.Directory = DBDirectory
          self.DatabaseName = ThisDatabaseName
  
          # I can't remember why this was in my c++ code...
          # if the new directory should be in another folder,
          # add the backslash, otherwise keep it free of
          # backslashes to make it in the current folder
          if len(self.Directory) &gt; 0:
              self.Directory = self.Directory + "\\"
  
          DatabasePath = self.Directory + self.DatabaseName
  
          print "Opening", DatabasePath
  
          EngineCommand = "sqlite:///"
          self.engine = sqlalchemy.create_engine(EngineCommand+DatabasePath, echo=Report)
          self.Session = sessionmaker(bind=self.engine)
          self.Base = declarative_base()
          try:
              self.DB = self.Session()
          except Error as e:
              print "An error occurred in making the database at", DatabasePath, ":", e.args[0]
  
          self.Base.metadata.create_all(self.engine)
  
  Statics = SQLAlchemyDatabase("", "Tester.db", True)
  </code></pre>
  
  <p>Here's the class code for the object:</p>
  
  <pre><code>class TestObj(Statics.Base):
      """ Objects that exist as a template for all base objects """
      __tablename__ = "TestObj"
  
      ID = Column(Text, primary_key=True) 
      ListOfTuples = Column(PickleType, primary_key=False) # List of dual int tuples
      Digit = Column(Integer, primary_key=False)
  
  
      def __init__(self,ID, ListOfTuples, Digit):
  
          # Unique Identifier
          self.ID = ID
          # List of paired int tuples
          self.ListOfTuples = ListOfTuples
          # Some other digit
          self.Digit = Digit
  
      def __repr__(self, ):
          return "&lt;Material ('%s', '%s', '%s')&gt;" % (self.ID, self.ListOfTuples, self.Digit)
  </code></pre>
  
  <p>Here's the code where I add, load, modify, and then check to see if the database updated:</p>
  
  <pre><code>print "Creating each TestObj"
  TestObj1 = TestObj("M001", [], 0)
  TestObj2 = TestObj("M002", [], 0)
  TestObj3 = TestObj("M003", [], 0)
  
  print "Creating the table in the DB"
  Statics.Base.metadata.create_all(Statics.engine)
  print "Adding each object to the table"
  Statics.DB.add(TestObj1)
  Statics.DB.add(TestObj2)
  Statics.DB.add(TestObj3)
  
  print "Querying the table for the objects"
  ListOfObjects = Statics.DB.query(TestObj).all()
  print ListOfObjects
  
  print "Modifying the objects to test updating"
  NewDigit = 1
  for EachObject in ListOfObjects:
      print EachObject
      EachObject.ListOfTuples.append((1,2))
      EachObject.Digit = NewDigit
      NewDigit += 1
      print "Now the Object is:", EachObject
  
  print "Seeing what is to be updated (should show all 3 objects with the ListOfTuples attribute for changing)"
  print Statics.DB.dirty
  
  print "Commit changes to DB"
  print Statics.DB.commit()
  
  print "Re-query the database to see what the values are now"
  ListOfObjects2 = Statics.DB.query(TestObj).all()
  print ListOfObjects 
  </code></pre>