Commit 04e815d9 authored by Daniel W Bond's avatar Daniel W Bond

advisor uses suburls

parent aa6239d9
......@@ -2,7 +2,7 @@ from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
# from django.contrib.auth.views import login, logout
from django.contrib.auth.views import login, logout
from advisor.views import index, about, privacy
#, login?
......@@ -37,6 +37,10 @@ urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
)
# App sub-urls
url(r'^trajectory/', include('trajectories.urls')),
url(r'^analysis/', include('analysis.urls'))
urlpatterns += patterns('django.contrib.auth.views',
# auth pages
url(r'^login$', 'login', {'template_name': 'login.html'},
......
......@@ -13,7 +13,7 @@ class BaseModel(models.Model):
class Course(BaseModel):
name = models.CharField(max_length = 150)
slug = models.SlugField(max_length = 50, unique=True)
courseSlug = models.SlugField(max_length = 50, unique=True)
# ordering
prerequisites = models.ManyToManyField('Course', related_name = 'prereqField', null=True)
......@@ -75,7 +75,7 @@ class CourseCollection(BaseModel):
class Program(BaseModel):
name = models.CharField(max_length = 150)
# slug = models.SlugField(max_length = 50, unique = True)
# programSlug = models.SlugField(max_length = 50, unique = True)
# courseCollections
courseReqs = models.ManyToManyField('CourseCollection',)
......@@ -137,7 +137,7 @@ post_save.connect(create_user_profile, sender=User)
class Trajectory(BaseModel):
name = models.CharField(max_length = 150)
slug = models.SlugField(max_length = 50, unique = True)
trajectorySlug = models.SlugField(max_length = 50, unique = True)
# Takes courses
previousCourses = models.ManyToManyField('Trajectory',)
......
......@@ -10,13 +10,13 @@ urlpatterns = patterns('',
# url(r'^blog/', include('blog.urls')),
# course
url(r'^course/(?P<courseName>\w+)/$', 'course', name = 'course'),
url(r'^course/(?P<courseSlug>\w+)/$', 'course', name = 'course'),
# student's page
url(r'^user/(?P<username>\w+)/$', 'student', name = 'student'),
url(r'^(?P<username>\w+)/$', 'student', name = 'student'),
# single trajectory page
url(r'^user/(?P<username>\w+)/(?P<trajectoryslug>\w+)$', 'trajectory', name = 'trajectory'),
url(r'^(?P<username>\w+)/(?P<trajectorySlug>\w+)$', 'trajectory', name = 'trajectory'),
# a new trajectory
# url(r'^user/(?P<username>\w+)/new/$', 'new', name = 'new'),
......@@ -25,5 +25,4 @@ urlpatterns = patterns('',
# creating the trajectory
# url(r'^user/(?P<username>\w+)/create/$', 'create', name = 'create'),
url(r'^create/$', 'create', name = 'create'),
)
......@@ -159,7 +159,7 @@ def student(request, slug):
# simply displays a page for the course
def course(request, slug):
course = get_object_or_404(Course, slug=slug)
course = get_object_or_404(Course, slug=slug) #courseSlug
return render(request, 'course.html', {
'course' : course,
......@@ -169,7 +169,7 @@ def course(request, slug):
# simply returns a page showing a program
# @login_required
def program (request):
program = get_object_or_404(Program, slug=slug)
program = get_object_or_404(Program, slug=slug) #programSlug
return render(request, 'program.html', {
'program' : program,
......@@ -180,7 +180,7 @@ def program (request):
# @login_required
def trajectory(request, slug):
# actually needs more than one slug, the one for the user
trajectory = get_object_or_404(Trajectory, slug=slug)
trajectory = get_object_or_404(Trajectory, slug=slug) #trajectorySlug
return render(request, 'trajectory.html', {
'trajectory' : trajectory,
......
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