Commit 4ca6df29 authored by Renfred Harper's avatar Renfred Harper

Add url settings to backbone models

parent 6c89efec
var advisor = advisor || {};
advisor.Course = Backbone.RelationalModel.extend({
urlRoot: '/api/courses',
defaults: {
dept: '',
......
var advisor = advisor || {};
advisor.Program = Backbone.RelationalModel.extend({
urlRoot: '/api/programs',
relations: [{
type: Backbone.HasMany,
key: 'requirements',
relatedModel: 'advisor.Requirement',
collectionType: 'RequirementCollection',
collectionType: 'advisor.RequirementCollection',
autoFetch: true,
reverseRelation: {
key: 'program',
includeInJSON: 'id'
......
var advisor = advisor || {};
advisor.Requirement = Backbone.RelationalModel.extend({
urlRoot: '/api/requirements',
defaults: {
name: '',
},
relations: [{
type: Backbone.HasMany,
key: 'courses',
relatedModel: 'advisor.Course',
collectionType: 'CourseCollection',
collectionType: 'advisor.CourseCollection',
autoFetch: true,
reverseRelation: {
key: 'satisfies',
includeInJSON: 'id'
......
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