eva/evapp/views.py

21 lines
492 B
Python
Raw Normal View History

from django.views.generic.edit import CreateView
2021-01-05 13:10:28 +00:00
from django.urls import reverse
from django.http import HttpResponse
from .models import Employee
from .forms import EmployeeForm
2020-12-23 10:42:57 +00:00
2021-01-05 13:10:28 +00:00
def success(request):
return HttpResponse("gut gemacht!")
class EvaFormView(CreateView):
model = Employee
form_class = EmployeeForm
2021-01-05 13:10:28 +00:00
def get_success_url(self):
return reverse('success')
def form_valid(self, form):
print("VALIDE!!!")
return super().form_valid(form)