chore: commit qui sert à rien

This commit is contained in:
N3WT DE COMPET
2025-02-13 17:13:31 +01:00
parent 9bf9c5f62d
commit cce78355a3
17 changed files with 210 additions and 143 deletions

View File

@ -0,0 +1,24 @@
from django.core.management.base import BaseCommand
from School.models import Establishment, StructureType
class Command(BaseCommand):
help = 'Initialize the establishment'
def handle(self, *args, **kwargs):
establishment_data = {
"name": "N3WT",
"address": "Société n3wt-innov 69 Chez LANA",
"total_capacity": 69,
"establishment_type": [StructureType.MATERNELLE, StructureType.PRIMAIRE],
"licence_code": ""
}
establishment, created = Establishment.objects.update_or_create(
name=establishment_data["name"],
defaults=establishment_data
)
if created:
self.stdout.write(self.style.SUCCESS('Establishment created successfully'))
else:
self.stdout.write(self.style.SUCCESS('Establishment updated successfully'))