Esempio n. 1
0
 def _create_in_db(context, updates):
     db_allocation = models.Allocation()
     db_allocation.update(updates)
     context.session.add(db_allocation)
     # We may be in a nested context manager so must flush so the
     # caller receives an id.
     context.session.flush()
     return db_allocation
Esempio n. 2
0
 def _create_in_db(context, updates):
     db_allocation = models.Allocation()
     db_allocation.update(updates)
     context.session.add(db_allocation)
     return db_allocation