def init_module_models(name, module): Models().initialise_model(name) print name print "#########" json = myjson.load_json("files/"+ name+ ".json") for j in json: to_exec = "module." + name.title() + "(" + str(j) + ")" p = eval(to_exec) Models().insert(name, p)
import myjson secret_key = 'a43%@3' products_path = 'files/products.json' users_path = 'files/users.json' public_users_field = ['username', 'city', 'postalcode', 'id'] public_products_field = [] products = myjson.load_json(products_path) users = myjson.load_json(users_path)