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

Merge branch 'master' of github.com:srct/advisor

parents 6d106066 77beb35d
......@@ -9,7 +9,7 @@ urlpatterns = patterns('',
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^api/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^', include('mainapp.urls')),
url(r'^login/$', 'django.contrib.auth.views.login', {
'template_name': 'login.html'
......
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Major.concentration'
db.delete_column(u'mainapp_major', 'concentration_id')
# Adding M2M table for field concentrations on 'Major'
m2m_table_name = db.shorten_name(u'mainapp_major_concentrations')
db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('major', models.ForeignKey(orm[u'mainapp.major'], null=False)),
('concentration', models.ForeignKey(orm[u'mainapp.concentration'], null=False))
))
db.create_unique(m2m_table_name, ['major_id', 'concentration_id'])
# Changing field 'Major.gened'
db.alter_column(u'mainapp_major', 'gened_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mainapp.GenEd'], null=True))
# Adding field 'Concentration.associatedmajors'
db.add_column(u'mainapp_concentration', 'associatedmajors',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mainapp.Major'], null=True),
keep_default=False)
def backwards(self, orm):
# User chose to not deal with backwards NULL issues for 'Major.concentration'
raise RuntimeError("Cannot reverse this migration. 'Major.concentration' and its values cannot be restored.")
# The following code is provided here to aid in writing a correct migration # Adding field 'Major.concentration'
db.add_column(u'mainapp_major', 'concentration',
self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mainapp.Concentration'], blank=True),
keep_default=False)
# Removing M2M table for field concentrations on 'Major'
db.delete_table(db.shorten_name(u'mainapp_major_concentrations'))
# User chose to not deal with backwards NULL issues for 'Major.gened'
raise RuntimeError("Cannot reverse this migration. 'Major.gened' and its values cannot be restored.")
# The following code is provided here to aid in writing a correct migration
# Changing field 'Major.gened'
db.alter_column(u'mainapp_major', 'gened_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['mainapp.GenEd']))
# Deleting field 'Concentration.associatedmajors'
db.delete_column(u'mainapp_concentration', 'associatedmajors_id')
models = {
u'auth.group': {
'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
u'auth.permission': {
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
u'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
u'mainapp.advisoradminuser': {
'Meta': {'object_name': 'AdvisorAdminUser'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'department': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'advisorname'", 'unique': 'True', 'to': u"orm['auth.User']"})
},
u'mainapp.buildresponse': {
'Meta': {'object_name': 'BuildResponse'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'programs': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Program']", 'symmetrical': 'False'}),
'semester': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mainapp.Semester']"})
},
u'mainapp.concentration': {
'Meta': {'object_name': 'Concentration', '_ormbases': [u'mainapp.Program']},
'associatedmajors': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mainapp.Major']", 'null': 'True'}),
u'program_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.Program']", 'unique': 'True', 'primary_key': 'True'})
},
u'mainapp.course': {
'Meta': {'object_name': 'Course', '_ormbases': [u'mainapp.MetaCourse']},
'corequisites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'coreq+'", 'blank': 'True', 'to': u"orm['mainapp.MetaCourse']"}),
'courseid': ('django.db.models.fields.IntegerField', [], {}),
'credits': ('django.db.models.fields.IntegerField', [], {}),
'dept': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
u'metacourse_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.MetaCourse']", 'unique': 'True', 'primary_key': 'True'}),
'prerequisites': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'prereq+'", 'blank': 'True', 'to': u"orm['mainapp.MetaCourse']"}),
'uniqname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'})
},
u'mainapp.coursegroup': {
'Meta': {'object_name': 'CourseGroup', '_ormbases': [u'mainapp.MetaCourse']},
'courses': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Course']", 'symmetrical': 'False'}),
u'metacourse_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.MetaCourse']", 'unique': 'True', 'primary_key': 'True'}),
'numneeded': ('django.db.models.fields.IntegerField', [], {})
},
u'mainapp.gened': {
'Meta': {'object_name': 'GenEd', '_ormbases': [u'mainapp.Program']},
u'program_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.Program']", 'unique': 'True', 'primary_key': 'True'})
},
u'mainapp.major': {
'Meta': {'object_name': 'Major', '_ormbases': [u'mainapp.Program']},
'concentrations': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['mainapp.Concentration']", 'null': 'True', 'blank': 'True'}),
'gened': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mainapp.GenEd']", 'null': 'True', 'blank': 'True'}),
u'program_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.Program']", 'unique': 'True', 'primary_key': 'True'})
},
u'mainapp.metacourse': {
'Meta': {'object_name': 'MetaCourse'},
'catalogyear': ('django.db.models.fields.IntegerField', [], {}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'unique_with': '()', 'max_length': '50', 'populate_from': "'title'"}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'mainapp.minor': {
'Meta': {'object_name': 'Minor', '_ormbases': [u'mainapp.Program']},
u'program_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.Program']", 'unique': 'True', 'primary_key': 'True'})
},
u'mainapp.program': {
'Meta': {'object_name': 'Program'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'requirements': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'reqs+'", 'symmetrical': 'False', 'to': u"orm['mainapp.Requirement']"}),
'slug': ('autoslug.fields.AutoSlugField', [], {'unique_with': '()', 'max_length': '50', 'populate_from': "'name'"})
},
u'mainapp.requirement': {
'Meta': {'object_name': 'Requirement'},
'courses': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.MetaCourse']", 'symmetrical': 'False'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
u'mainapp.semester': {
'Meta': {'object_name': 'Semester'},
'courses': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Course']", 'symmetrical': 'False', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'nextsemester': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mainapp.Semester']", 'null': 'True', 'blank': 'True'}),
'number': ('django.db.models.fields.IntegerField', [], {}),
'programs': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Program']", 'symmetrical': 'False'}),
'requirementssatisfied': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'reqssatisfied+'", 'blank': 'True', 'to': u"orm['mainapp.Requirement']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['mainapp.Student']"})
},
u'mainapp.student': {
'Meta': {'object_name': 'Student'},
'advisorname': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.AdvisorAdminUser']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'coursestaken': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['mainapp.Course']", 'null': 'True', 'blank': 'True'}),
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
'dateOfGrad': ('django.db.models.fields.DateField', [], {}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'programs': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Program']", 'symmetrical': 'False'}),
'slug': ('autoslug.fields.AutoSlugField', [], {'max_length': '50', 'unique_with': '()', 'null': 'True', 'populate_from': "'user'"}),
'trajectory': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['mainapp.Trajectory']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['auth.User']", 'unique': 'True'})
},
u'mainapp.trajectory': {
'Meta': {'object_name': 'Trajectory'},
'created': ('model_utils.fields.AutoCreatedField', [], {'default': 'datetime.datetime.now'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('model_utils.fields.AutoLastModifiedField', [], {'default': 'datetime.datetime.now'}),
'semesters': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['mainapp.Semester']", 'symmetrical': 'False'}),
'user': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'trajectory'", 'unique': 'True', 'to': u"orm['auth.User']"})
}
}
complete_apps = ['mainapp']
\ No newline at end of file
......@@ -59,8 +59,9 @@ class Program(TimeStampedModel):
class Major(Program):
gened = models.ForeignKey('GenEd')
concentration = models.ForeignKey('Concentration', blank=True)
gened = models.ForeignKey('GenEd', blank=True, null=True)
concentrations = models.ManyToManyField('Concentration', blank=True,
null=True)
class Minor(Program):
......@@ -72,7 +73,7 @@ class GenEd(Program):
class Concentration(Program):
pass
associatedmajors = models.ForeignKey(Major, null=True)
class Requirement(TimeStampedModel):
......
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from mainapp.views import (ProgramViewSet, CourseViewSet, CourseGroupViewSet,
TrajectoryViewSet, build_trajectory, SemesterViewSet, BuildResponseViewSet,
DetailStudent, ProfileView)
......@@ -19,7 +20,8 @@ urlpatterns = patterns('',
# Examples:
# url(r'^$', 'advisor.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^', include(router.urls)),
url(r'^$', TemplateView.as_view(template_name='index.html')),
url(r'^api/', include(router.urls)),
url(r'^build/', build_trajectory, name='build'),
url(r'^student/(?P<slug>[^/]+)/$', DetailStudent.as_view(),
name='detail-student'),
......
{% extends "rest_framework/base.html" %}
{% block title %}
<title> Advisor API 1.0 </title>
Advisor API 1.0
{% endblock %}
{% block footer %}
We're SRCT we're awesome.
......
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