add namespace import
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
2026-06-19 15:58:38 +01:00
parent e74b659b45
commit aa0939be6d
7 changed files with 105 additions and 18 deletions
+8 -1
View File
@@ -1,7 +1,9 @@
from django.http import HttpResponse
# IMPORT AT THE TOP HERE: This is completely safe!
from apps.cloudmanager.models import Machine_Data,Schedule_Week_Data
from apps.cloudmanager.models import Deployment_Data,Schedule_Week_Data
from apps.kubernetes_connection.utils import get_namespace
from .models import namespace_cmm_data_object
def coucou(request):
# 1. Prepare the data inside the function
@@ -23,3 +25,8 @@ def display(request):
print(data[0].namespace)
return HttpResponse(data)
def import_namespace(queryset):
namespaces_list = get_namespace()
for namespace in namespaces_list:
queryset.create(namespace=namespace)