changeset 228:c49ebe560af2

fixed dbmanage script to work as standalone script
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 27 May 2010 00:04:29 +0200
parents 351013049742
children 69a29242ba61
files pylons_app/lib/db_manage.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/lib/db_manage.py	Wed May 26 23:55:48 2010 +0200
+++ b/pylons_app/lib/db_manage.py	Thu May 27 00:04:29 2010 +0200
@@ -2,13 +2,17 @@
 from os.path import dirname as dn
 from sqlalchemy.engine import create_engine
 import os
+import sys
+ROOT = dn(dn(dn(os.path.realpath(__file__))))
+sys.path.append(ROOT)
+
 from pylons_app.model.db import Users
 from pylons_app.model.meta import Session
 
 from pylons_app.lib.auth import get_crypt_password
 from pylons_app.model import init_model
 
-ROOT = dn(dn(dn(os.path.realpath(__file__))))
+
 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s')
 from pylons_app.model.meta import Base