Commit cd621477 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

create view, imported forms

parent d6de3795
...@@ -3,9 +3,17 @@ from django.shortcuts import render ...@@ -3,9 +3,17 @@ from django.shortcuts import render
from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView
from accounts.models import Student from accounts.models import Student
from accounts.forms import StudentForm
from braces.views import LoginRequiredMixin from braces.views import LoginRequiredMixin
# create a student
class CreateStudent(LoginRequiredMixin, CreateView):
model = Student
form_class = StudentForm
success_url = '/' #redirect location tba
login_url = '/'
# details about the student # details about the student
class DetailStudent(LoginRequiredMixin, DetailView): class DetailStudent(LoginRequiredMixin, DetailView):
model = Student model = Student
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment