Version 1 (modified by 14 years ago) ( diff ) | ,
---|
TracDev/ApiChanges/0.13
Summary
Prerequisites
Python 2.4 support has been dropped. Python versions 2.5, 2.6 and 2.7 are supported.
Modified Dependencies
Babel (optional)
The internationalization support (i18) for Trac is depending on Babel.
Q: Should we now make Babel a mandatory dependency, as we have a good stable release?
This would allow us to use the Babel API in more places (e.g. #4636, #2182).
Modifications made to the 0.12 API
Other Changes
Environment.get_db_cnx
is obsolete
Following the deprecation deprecation made in 0.12, using Environment.get_db_cnx
for obtaining a database connection is now no longer necessary.
One should use the context managers for retrieving a database Connection in read or write mode. TODO
- a read-only Connection can be used to form queries:
a
with env.db_query as db: ...
db
instance obtained the above way should only be used for executing SELECT queries - a write Connection can be used to modify the database content in a transaction:
a
with env.db_transaction as db: ...
db
instance obtained the above way can be used to execute INSERT/UPDATE/DELETE queries; they will be committed when the last such automatic transaction in the control flow completes successfully (see details further down)
New in the 0.13 API
Other news
Environment.db_query()
and Environment.db_transaction()
(0.13)
The @with_transaction(env)
/ @env.with_transaction()
decorators introduced in 0.12 remain available, but they're now deprecated as well, as the with
syntax is to be preferred. TODO
See #8751 for details and related notes about get_db_cnx deprecation above.