|
|
@ -185,11 +185,11 @@ local function env_ip(ip) |
|
|
|
end |
|
|
|
|
|
|
|
function M.create_app() |
|
|
|
inp.open({ prompt = "create app: " }, perform_create_app) |
|
|
|
inp.open({ prompt = "create app: " },{},perform_create_app) |
|
|
|
end |
|
|
|
|
|
|
|
function M.create_package() |
|
|
|
inp.open({ prompt = "create package: " }, perform_create_package) |
|
|
|
inp.open({ prompt = "create package: " },{}, perform_create_package) |
|
|
|
end |
|
|
|
|
|
|
|
function M.create_env_file(opts) |
|
|
@ -283,5 +283,35 @@ function M.compile_messages() |
|
|
|
toggleterm.exec("./manage.py compilemessages", term_num, 100, ".", "float", "compile_messages", false) |
|
|
|
end |
|
|
|
|
|
|
|
local function perform_dump_data(value) |
|
|
|
local term_num = 13 |
|
|
|
toggleterm.exec( |
|
|
|
"./manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission -e sessions.session -e admin.logentry --indent 2 > " .. value .. ".json", |
|
|
|
term_num, |
|
|
|
100, |
|
|
|
".", |
|
|
|
"float", |
|
|
|
"dump_data", |
|
|
|
false |
|
|
|
) |
|
|
|
end |
|
|
|
|
|
|
|
local function perform_load_data(value) |
|
|
|
local term_num = 14 |
|
|
|
toggleterm.exec("./manage.py loaddata" .. value .. ".json", term_num, 100, ".", "float", "load_data", false) |
|
|
|
end |
|
|
|
|
|
|
|
function M.dump_data() |
|
|
|
inp.open({ prompt = "name: ", default_value ="dump_db"}, |
|
|
|
{popup = {border = {text = {top ="Dump data", top_align="left"}}}}, |
|
|
|
perform_dump_data) |
|
|
|
end |
|
|
|
|
|
|
|
function M.load_data() |
|
|
|
inp.open({ prompt = "name: ", default_value = "dump_db"}, |
|
|
|
{ popup = {border = {text = {top ="Load data", top_align="left"}}}}, |
|
|
|
perform_load_data) |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
return M |
|
|
|