trac-hacks / tracstats

Project and source code statistics plugin for Trac.
http://trac-hacks.org/wiki/TracStatsPlugin
Other
20 stars 13 forks source link

Replace deprecated get_db_cnx method #42

Closed miihael closed 9 years ago

miihael commented 9 years ago

Environment.get_db_cnx() method was marked as deprecated in Trac 1.0 and was removed in Trac 1.1.1.

See also: http://trac.edgewall.org/ticket/11605

mrjbq7 commented 9 years ago

Great, thanks! I might try and write it to be backwards compatible with Trac 1.0. Didn't know db had been changed!

miihael commented 9 years ago

My changes are compatible with Trac 1.0. with self.env.db_transaction is 1.0 API - see http://trac.edgewall.org/wiki/TracDev/DatabaseApi

mrjbq7 commented 9 years ago

Awesome, thanks!

Looks like we can use env.db_query also since this is read-only queries, and it gets automatically closed which should clean up the code a little.

mrjbq7 commented 9 years ago

(I'll go ahead and make that change too)