Add: import from subfolders

This commit is contained in:
Aroy-Art 2023-08-27 16:24:55 +02:00
parent 90a6b3d32b
commit 0072b8dfbd
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -53,10 +53,11 @@ class Command(BaseCommand):
tqdm.write(self.style.ERROR(f"The folder '{folder_path}' does not exist."))
return
for file_name in tqdm(os.listdir(folder_path), dynamic_ncols=True):
if file_name.endswith('.json'):
file_path = os.path.join(folder_path, file_name)
self.process_json_file(file_path)
for root, dirs, files in tqdm(os.walk(folder_path), dynamic_ncols=True):
for file_name in files:
if file_name.endswith('.json'):
file_path = os.path.join(root, file_name)
self.process_json_file(file_path)
def import_data(self, data, json_file_path):