This is the views.py file
from helpers import random_password
from django.views.generic.edit import CreateView
from django.views.generic.list import ListView
from Prototype.forms import StudentForm, LecturerForm, PaymentForm
from Prototype.models import Guideline, Student, Lecturer, Payment
from Prototype.models import Course
class GuidelineListView(ListView):
model = Guideline
template_name = 'content.html'
context_object_name = 'guidelines'
class Registration(CreateView):
model = Student
form_class = StudentForm
template_name = "newAccount.html"
success_url = "/Payment/"
context_object_name = 'form'
def send_sms(self):
#send sms
password = random_password()
def post(self):
'''generate password and send it to the user.'''
return Super(Register, self).post()
class NewLecturer(CreateView):
model = Lecturer
form_class = LecturerForm
template_name = "newAccount.html"
success_url = "/login/"
context_object_name = 'lecturer_form'
class CourseListView(ListView):
model = Course
template_name = 'index.html'
context_object_name = 'courses'
class Payment(CreateView):
model = Payment
form_class = PaymentForm
template_name = 'Payment.html'
success_url = "/login/"
context_object_name = 'payments'