I\'m making a Pyramid app using SQLAlchemy-0.7.8. I\'m using 64bit Python3.2.
The question is, why does the following function not commit anything to the database?>
You need to commit your transaction.
You can do this explicitly (by calling DBSession.commit() or by using the pyramid_tm middleware; the latter commits transactions automatically on successful responses (with a 2xx HTTP response).
The latter only commits transactions for SQLAlchemy if you use the ZopeTransactionExtension extension with your session maker:
from zope.sqlalchemy import ZopeTransactionExtension
DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))
If you are already using the ZopeTransactionExtension and want to explicitly commit your transactions, you need to use the transaction package:
import transaction
transaction.commit()