title: Flask-Sqlalchemy saving children one-to-many issue
body: <p>I am very confused and I am trying to add children to an existing parent object in the database. When trying to do that I get an error. </p>
  
  <p>I am unsure about how to make sure my newly added children object gets saved?
  The error and my attempts are below:</p>
  
  <pre><code>equityLinkedNote = db.session.query(EquityLinkedNote).filter(EquityLinkedNote.cmdb == cmdb_eln.cmdb)
  underlier_list = underliers.to_dict(orient="records")
      equityLinkedNote.Underlier =\
                  [UnderlierDetails(
                  Ticker=underlier["Ticker"] if "Ticker" in underlier else None,
                  Weight=underlier["Weight"] if "Weight" in underlier else None,
                  ReturnFloor=underlier["ReturnFloor"] if "ReturnFloor" in underlier else None,
                  InitialFixing=underlier["InitialFixing"] if "InitialFixing" in underlier else None,
                  ReturnCap=underlier["ReturnCap"] if "ReturnCap" in underlier else None,
                  EffectiveDate=underlier["EffectiveDate"] if "EffectiveDate" in underlier else cmdb_eln.trade_date
                  ) for underlier in underlier_list]
      db.session.flush()
      db.session.commit()
  </code></pre>
  
  <p><strong>ERROR</strong></p>
  
  <pre><code>File "....\lib\site-packages\sqlalchemy\ext\declarative\base.py", line 747, in _declarative_constructor
      setattr(self, k, kwargs[k])
    File "...\site-packages\sqlalchemy\orm\attributes.py", line 229, in __set__
      instance_dict(instance), value, None)
    File "...\site-packages\sqlalchemy\orm\attributes.py", line 711, in set
      state._modified_event(dict_, self, old)
  AttributeError: 'NoneType' object has no attribute '_modified_event'
  </code></pre>
  
  <p>I have no idea why this is failing. any help will be appreciated!</p>
  
  <p>Here are my models</p>
  
  <pre><code>class EquityLinkedNote(GenericSecMasterObject):
      Underlier = db.relationship("UnderlierDetails", backref='note', cascade="save-update, merge, delete", lazy='dynamic',
                                  collection_class=list)
  </code></pre>
  
  <p><strong>Underlier</strong></p>
  
  <pre><code>class UnderlierDetails(db.Model):
      __tablename__ = "underlier_details"
      id = db.Column(db.Integer, primary_key=True)
      Ticker = db.Column(db.String(50), nullable=False)
      InitialFixing = db.Column(db.Float, nullable=True)  
      ReturnCap = db.Column(db.Float, nullable=True)  
      ReturnFloor = db.Column(db.Float, nullable=True)  
      Weight = db.Column(db.Float, nullable=True)
      EffectiveDate = db.Column(db.DateTime, nullable=False)
      cmdb = db.Column(db.String(20), db.ForeignKey('sec_master_details.cmdb'), nullable=False)
  </code></pre>