diff --git a/app/models/blocs.py b/app/models/blocs.py index 2e2eb60..b22bf2c 100644 --- a/app/models/blocs.py +++ b/app/models/blocs.py @@ -7,21 +7,17 @@ from os import remove, path class MyBlocs: - + + def new(blocName, blocType): + mybloc = None + if blocType in MyBlocs.listTypeBlocs(): + mybloc=dict() + mybloc['name'] = str(blocName) + mybloc['type'] = str(blocType) + return mybloc + def makeForm(bloc): - match bloc['type']: - case 'presentation' : - form = Accueil() - case 'text' : - form = Description() - case 'external_link': - form = Lien() - case 'gallery': - form = ImageForm() - case 'contact': - form = Contact() - case _: - form = None + form = FormBloc() return form def imgForm(): @@ -29,3 +25,5 @@ class MyBlocs: def newImgForm(): return ImageUpload() + +