from .models import Video from apps.crud import CRUD, post, edit, delete, vista from .forms import VideosForm # Create your views here. def nosotros(request): return render(request, 'core/nosotros.html') def proyecto(request): return render(request, 'core/proyecto.html') def send_email(request): return render(request, 'core/contact.html') contexto = {'videos': Video} video = CRUD(Video, 'core/', 'index', VideosForm, '', contexto=contexto) index = lambda request: vista(request, video) video_post = lambda request: post(request, video) video_edit = lambda request, pk: edit(request, pk, video) video_delete = lambda request, pk: delete(request, pk, video)
from .forms import PostForm, PostEdAsteroidesForm from .models import AsteroidesDefEd, PostEdAsteroides from apps.crud import CRUD, vista, post, edit, delete contexto = {'terminos': AsteroidesDefEd, 'general': PostEdAsteroides} asteroide = CRUD(AsteroidesDefEd, 'educacion/asteroide/', 'asteroide', PostForm, 'ed_', contexto) ed_asteroide = lambda request: vista(request, asteroide) ed_asteroide_post = lambda request: post(request, asteroide) ed_asteroide_edit = lambda request, pk: edit(request, pk, asteroide) ed_asteroide_delete = lambda request, pk: delete(request, pk, asteroide) asteroide_general = CRUD(PostEdAsteroides, 'educacion/asteroide/', 'asteroide', PostEdAsteroidesForm, 'ed_') ed_asteroide_general_post = lambda request: post(request, asteroide_general) ed_asteroide_general_edit = lambda request, pk: edit(request, pk, asteroide_general) ed_asteroide_general_delete = lambda request, pk: delete( request, pk, asteroide_general)
from .forms import PostForm, PostAcVolcanForm from .models import VolcanDefAc, PostAcVolcan from apps.crud import CRUD, vista, edit, delete, post contexto = {'terminos' : VolcanDefAc, 'general' : PostAcVolcan} volcan = CRUD(VolcanDefAc, 'accion/erupcion/', 'erupcion', PostForm, 'ac_', contexto) ac_erupcion = lambda request : vista(request, volcan) ac_erupcion_post = lambda request : post(request, volcan) ac_erupcion_edit = lambda request, pk : edit(request, pk, volcan) ac_erupcion_delete = lambda request, pk : delete(request, pk, volcan) volcan_general = CRUD(PostAcVolcan, 'accion/erupcion/', 'erupcion', PostAcVolcanForm, 'ac_') ac_erupcion_general_post = lambda request : post(request, volcan_general) ac_erupcion_general_edit = lambda request, pk : edit(request, pk, volcan_general) ac_erupcion_general_delete = lambda request, pk : delete(request, pk, volcan_general)
from .forms import PostForm, PostRefLaderaForm from .models import LaderaDefRef, PostRefLadera from apps.crud import CRUD, vista, post, edit, delete contexto = {'terminos': LaderaDefRef, 'general': PostRefLadera} ladera = CRUD(LaderaDefRef, 'reflexion/ladera/', 'ladera', PostForm, 'ref_', contexto) ref_ladera = lambda request: vista(request, ladera) ref_ladera_post = lambda request: post(request, ladera) ref_ladera_edit = lambda request, pk: edit(request, pk, ladera) ref_ladera_delete = lambda request, pk: delete(request, pk, ladera) ladera_general = CRUD(PostRefLadera, 'reflexion/ladera/', 'ladera', PostRefLaderaForm, 'ref_') ref_ladera_general_post = lambda request: post(request, ladera_general) ref_ladera_general_edit = lambda request, pk: edit(request, pk, ladera_general) ref_ladera_general_delete = lambda request, pk: delete(request, pk, ladera_general)
from .forms import PostForm, PostEdInundacionForm from .models import InundacionesDefEd, PostEdInundacion from apps.crud import CRUD, vista, post, edit, delete contexto = {'terminos': InundacionesDefEd, 'general': PostEdInundacion} inundacion = CRUD(InundacionesDefEd, 'educacion/inundacion/', 'inundacion', PostForm, 'ed_', contexto) ed_inundacion = lambda request: vista(request, inundacion) ed_inundacion_post = lambda request: post(request, inundacion) ed_inundacion_edit = lambda request, pk: edit(request, pk, inundacion) ed_inundacion_delete = lambda request, pk: delete(request, pk, inundacion) inundacion_general = CRUD(PostEdInundacion, 'educacion/inundacion/', 'inundacion', PostEdInundacionForm, 'ed_') ed_inundacion_general_post = lambda request: post(request, inundacion_general) ed_inundacion_general_edit = lambda request, pk: edit(request, pk, inundacion_general) ed_inundacion_general_delete = lambda request, pk: delete( request, pk, inundacion_general)
from django.shortcuts import render # Create your views here. from .forms import PostForm from .models import PostProyecto from apps.crud import CRUD, post, edit, delete, vista proyecto = CRUD(PostProyecto, 'proyectos/', 'proyectos', PostForm, '') proyectos = lambda request: vista(request, proyecto) proyectos_post = lambda request: post(request, proyecto) proyectos_edit = lambda request, pk: edit(request, pk, proyecto) proyectos_delete = lambda request, pk: delete(request, pk, proyecto)
from .forms import PostForm, PostEdSismoForm from .models import SismoDefEd, PostEdSismo from apps.crud import CRUD, vista, post, edit, delete contexto = {'terminos': SismoDefEd, 'general': PostEdSismo} sismo = CRUD(SismoDefEd, 'educacion/sismo/', 'sismo', PostForm, 'ed_', contexto) ed_sismo = lambda request: vista(request, sismo) ed_sismo_post = lambda request: post(request, sismo) ed_sismo_edit = lambda request, pk: edit(request, pk, sismo) ed_sismo_delete = lambda request, pk: delete(request, pk, sismo) sismo_general = CRUD(PostEdSismo, 'educacion/sismo/', 'sismo', PostEdSismoForm, 'ed_') ed_sismo_general_post = lambda request: post(request, sismo_general) ed_sismo_general_edit = lambda request, pk: edit(request, pk, sismo_general) ed_sismo_general_delete = lambda request, pk: delete(request, pk, sismo_general )
#Principal educacion = CRUD(Principal, 'core/', 'educacion', PrincipalForm, 'ed_', contexto=contexto) ed_educacion = lambda request: vista(request, educacion) ed_educacion_post = lambda request: post(request, educacion) ed_educacion_edit = lambda request, pk: edit(request, pk, educacion) ed_educacion_delete = lambda request, pk: delete(request, pk, educacion) #Glosario glosario = CRUD(Glosario, 'core/', 'educacion', GlosarioForm, 'ed_') ed_glosario_post = lambda request: post(request, glosario) ed_glosario_edit = lambda request, pk: edit(request, pk, glosario) ed_glosario_delete = lambda request, pk: delete(request, pk, glosario) #Referencias referencia = CRUD(Referencia, 'core/', 'educacion', ReferenciaForm, 'ed_') ed_referencia_post = lambda request: post(request, referencia)