comparison rhodecode/model/__init__.py @ 2897:1f7b8c73c94a

Merge with beta
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 08 Oct 2012 22:37:09 +0200
parents 63e58ef80ef1 12fce5e499d5
children 5293d4bbb1ea
comparison
equal deleted inserted replaced
2880:3c7c24f9031f 2897:1f7b8c73c94a
41 # You should have received a copy of the GNU General Public License 41 # You should have received a copy of the GNU General Public License
42 # along with this program. If not, see <http://www.gnu.org/licenses/>. 42 # along with this program. If not, see <http://www.gnu.org/licenses/>.
43 43
44 import logging 44 import logging
45 from rhodecode.model import meta 45 from rhodecode.model import meta
46 from rhodecode.lib.utils2 import safe_str 46 from rhodecode.lib.utils2 import safe_str, obfuscate_url_pw
47 47
48 log = logging.getLogger(__name__) 48 log = logging.getLogger(__name__)
49 49
50 50
51 def init_model(engine): 51 def init_model(engine):
54 Call this before using any of the tables or classes in the model, 54 Call this before using any of the tables or classes in the model,
55 preferably once in application start 55 preferably once in application start
56 56
57 :param engine: engine to bind to 57 :param engine: engine to bind to
58 """ 58 """
59 log.info("initializing db for %s" % engine) 59 engine_str = obfuscate_url_pw(str(engine.url))
60 log.info("initializing db for %s" % engine_str)
60 meta.Base.metadata.bind = engine 61 meta.Base.metadata.bind = engine
61 62
62 63
63 class BaseModel(object): 64 class BaseModel(object):
64 """ 65 """