From: Seth Woodworth Date: Sat, 7 Jan 2012 17:38:40 +0000 (-0500) Subject: adding schema for harvard courses via cs50.net X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a1ae67c2b8a8b23d7417530a3b963896ca443bd0;p=oweals%2Ffinalsclub.git adding schema for harvard courses via cs50.net --- diff --git a/models.js b/models.js index 15b8125..ee34931 100644 --- a/models.js +++ b/models.js @@ -161,6 +161,39 @@ SchoolSchema.method( 'authorize', function( user, cb ) { var School = mongoose.model( 'School', SchoolSchema ); +// harvardcourses + +var HarvardCourses = new Schema( { + cat_num : Number, // Catalog numb, unique_togther w/ term + term : String, // FALL or SPRING + bracketed : Boolean, + field : String, // TODO: Add docs + number : Number, // string, int, float, intStringFloat + title : String, + faculty : String, // hash fk to faculty table + description : String, + prerequisites : String, + notes : String, + meetings : String, // TODO: try to auto parse this + building : String, // FIXME: Most == '', this is why we have to update + room : String +}); + +HarvardCourses.virtual( 'sanitized' ).get(function() { + var class = { + _id : this._id, + title : this.name, + field : this.field, + number : this.number, + desc : this.description, + meetings: this.meetings, + building: this.building, + room : this.room, + faculty : this.faculty + } + return class +}) + // courses var CourseSchema = new Schema( {