Commit ef8f64b5 authored by Ben Waters's avatar Ben Waters
Browse files

switched some views from fbv to cbv

parent 9c512fe8
from django.shortcuts import render, render_to_response
from trajectories.models import Course, CourseCollection, Program, Student, Trajectory
from django.db.models import Max
from django.views.generic import *
# other functions
......@@ -116,13 +117,6 @@ def index(request):
},
)
def login(request):
return render(request, 'login.html', {
},
)
# SRCT, how to contribute information
def about(request):
......@@ -133,32 +127,22 @@ def about(request):
# student creates trajectory
# def create(request, slug):
def create(request):
# needs to get list of programs from user
def trajectory_create(CreateView):
template_name = 'create.html'
model = Trajectory
programs = []
#
return render(request, 'create.html', {
},
)
# just displays a page for the course
def course(request, slug):
return render(request, 'course.html', {
},
)
def trajectory(request, slug):
# actually needs more than one slug
return render(request, 'trajectory.html', {
},
)
def trajectory_detail(DetailView):
template_name = 'trajectory.html'
model = Trajectory
def trajectory_update(UpdateView):
template_name = 'create.html'
model = Trajectory
def trajectory_delete(DeleteView):
pass
def course_detail(DetailView):
template_name = 'course.html'
model = Course
# student's page; shows saved trajectories
#@login_required
......
Django==1.6
Pillow==2.3.0
South==0.8.4
argparse==1.2.1
django-appconf==0.6
django-auth-ldap==1.1.7
django-dynamic-forms==0.2
django-guardian==1.1.1
django-mptt==0.6.0
django-userena==1.2.4
easy-thumbnails==1.4
html2text==3.200.3
six==1.5.2
wsgiref==0.1.2
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