EVA/evapp/views.py

21 lines
492 B
Python

from django.views.generic.edit import CreateView
from django.urls import reverse
from django.http import HttpResponse
from .models import Employee
from .forms import EmployeeForm
def success(request):
return HttpResponse("gut gemacht!")
class EvaFormView(CreateView):
model = Employee
form_class = EmployeeForm
def get_success_url(self):
return reverse('success')
def form_valid(self, form):
print("VALIDE!!!")
return super().form_valid(form)