From 272feb3746665c539e7d45b631f26a9364d497a0 Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Sun, 5 Jan 2025 12:23:22 -0300 Subject: [PATCH] feature: reset data --- lua/django/mappings.lua | 8 ++++++-- lua/django/utils.lua | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) 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