From 344d48d867a719ed70f8c5d6edf3dfd1a10da310 Mon Sep 17 00:00:00 2001 From: Diego Resende Date: Tue, 21 May 2019 18:29:43 -0300 Subject: [PATCH] feat(#1): add templates for test --- students/templates/student-form.html | 17 +++++++++++++++++ students/templates/students.html | 12 ++++++++++++ students/views.py | 4 +++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 students/templates/student-form.html create mode 100644 students/templates/students.html diff --git a/students/templates/student-form.html b/students/templates/student-form.html new file mode 100644 index 0000000..a26f95a --- /dev/null +++ b/students/templates/student-form.html @@ -0,0 +1,17 @@ + + + + + + + Document + + +

New Student

+
+ {% csrf_token %} + {{ form }} + +
+ + \ No newline at end of file diff --git a/students/templates/students.html b/students/templates/students.html new file mode 100644 index 0000000..c58313c --- /dev/null +++ b/students/templates/students.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

Teste

+ + \ No newline at end of file diff --git a/students/views.py b/students/views.py index fd660a2..4cea945 100644 --- a/students/views.py +++ b/students/views.py @@ -6,4 +6,6 @@ def create_student(resquest): form = StudentForm(resquest.POST or None) if form.is_valid(): - form.save() \ No newline at end of file + form.save() + + return render(resquest, 'student-form.html', {'form': form}) \ No newline at end of file