diff --git a/lua/django/mappings.lua b/lua/django/mappings.lua index f8601b2..b66310e 100644 --- a/lua/django/mappings.lua +++ b/lua/django/mappings.lua @@ -21,8 +21,12 @@ local mappings = { end, desc = "load data", }, - - + ["jt"] = { + function() + django.reset_data() + end, + desc = "reset data", + }, ["jp"] = { function() django.create_package() diff --git a/lua/django/utils.lua b/lua/django/utils.lua index b6b8323..475f83d 100644 --- a/lua/django/utils.lua +++ b/lua/django/utils.lua @@ -313,5 +313,9 @@ function M.load_data() perform_load_data) end +function M.reset_data() + local term_num =15 + toggleterm.exec("./manage.py resetdata", term_num, 100, ".", "float", "reset_data", false) +end return M