Changeset - 911dab498eb2
[Not reviewed]
default
0 1 0
Marcin Kuzminski - 16 years ago 2010-04-19 22:52:31
marcin@python-works.com
Updated db manage
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/db_manage.py
Show inline comments
 
@@ -12,15 +12,16 @@ def get_sqlite_conn_cur():
 
    cur = conn.cursor()
 
    return conn, cur
 

	
 
def check_for_db():
 
def check_for_db(override):
 
    if not override:
 
    if os.path.isfile(os.path.join(ROOT, 'hg_app.db')):
 
        raise Exception('database already exists')
 

	
 
def create_tables():
 
def create_tables(override=False):
 
    """
 
    Create a auth database
 
    """
 
    check_for_db()
 
    check_for_db(override)
 
    conn, cur = get_sqlite_conn_cur()
 
    try:
 
        logging.info('creating table %s', 'users')
 
@@ -65,7 +66,7 @@ def create_user(username, password, admi
 
        raise
 
    
 
if __name__ == '__main__':
 
    create_tables()
 
    create_tables(True)
 
    admin_prompt()  
 

	
 

	
0 comments (0 inline, 0 general)