PEATDB/zodbtest.py
def convertEkinprjs(local=None, server=None,
                    project=None, username=None):
    """convert old ekin prjs in a db to new"""
    if local != None:
        DB = PDatabase(local=local)
    elif server != None:
        DB = PDatabase(server=server, username='farrell', port=8080,
                          password='123', project=project)
    
    for f in DB['userfields']:
        if DB['userfields'][f]['field_type'] in ekintypes:
            print f
            for r in DB.getRecs():
                rec = DB[r]
                if rec.has_key(f):
                    E=rec[f]
                    E.checkDatasets()
                    for d in E.datasets:
                        ek=E.getDataset(d)
                        #ek.prettyPrint()   
                    rec[f] = E                
                  
    print DB.getChanged()  
    DB.commit('converted ekin data')   
    return
convert old ekin prjs in a db to new
convert old ekin prjs in a db to new
convert old ekin prjs in a db to new
def convertEkinprjs(local=None, server=None,
                    project=None, username=None):
    if local != None:
        DB = PDatabase(local=local)
    elif server != None:
        DB = PDatabase(server=server, username='farrell', port=8080,
                          password='123', project=project)
    for f in DB['userfields']:
        if DB['userfields'][f]['field_type'] in ekintypes:
            print f
            for r in DB.getRecs():
                rec = DB[r]
                if rec.has_key(f):
                    E=rec[f]
                    E.checkDatasets()
                    for d in E.datasets:
                        ek=E.getDataset(d)
                    rec[f] = E                
    print DB.getChanged()  
    DB.commit('converted ekin data')   
    return
def convertEkinprjs ( local = None , server = None , project = None , username = None ) : if local != None : DB = PDatabase ( local = local ) elif server != None : DB = PDatabase ( server = server , username = 'farrell' , port = 8080 , password = '123' , project = project ) for f in DB [ 'userfields' ] : if DB [ 'userfields' ] [ f ] [ 'field_type' ] in ekintypes : print f for r in DB . getRecs ( ) : rec = DB [ r ] if rec . has_key ( f ) : E = rec [ f ] E . checkDatasets ( ) for d in E . datasets : ek = E . getDataset ( d ) rec [ f ] = E print DB . getChanged ( ) DB . commit ( 'converted ekin data' ) return
convert old ekin prjs in a db to new
convert old ekin prjs in a db to new
"""convert old ekin prjs in a db to new""" #ek.prettyPrint()   
local
server
project
username