From ab4cdab12da2ccb721b2fd938567e317419d7398 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Mon, 15 Jun 2015 18:34:02 +0300 Subject: [PATCH] removed project list from course and added course to project --- models/Course.py | 4 ++-- models/Project.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/models/Course.py b/models/Course.py index 4b3abe5..fd2dc08 100644 --- a/models/Course.py +++ b/models/Course.py @@ -7,7 +7,7 @@ class Course(db.Model): courseName = db.StringProperty(required=True) campusName = db.StringProperty(required=True) master_id = db.IntegerProperty(required=True) - projects = db.StringListProperty(required=True,default=[]) + # projects = db.StringListProperty(required=True,default=[]) startDate = db.DateProperty(required=True) endDate = db.DateProperty(required=True) @@ -15,7 +15,7 @@ class Course(db.Model): data = {'courseName' : self.courseName, 'campusName' : self.campusName, 'master_id' : self.master_id, - 'projects' : self.projects, + # 'projects' : self.projects, 'startDate' : { 'year': self.startDate.year, 'month': self.startDate.month, diff --git a/models/Project.py b/models/Project.py index 97db04e..579ecdd 100644 --- a/models/Project.py +++ b/models/Project.py @@ -5,6 +5,7 @@ from google.appengine.ext import db class Project(db.Model): projectName = db.StringProperty(required=True) + courseName = db.StringProperty(required=True) master_id = db.IntegerProperty(required=True) grade = db.IntegerProperty(required=True, default=0) logo_url = db.StringProperty(required=False) @@ -13,6 +14,7 @@ class Project(db.Model): def to_JSON(self): data = {'projectName' : self.projectName, + 'courseName' : self.courseName, 'master_id' : self.master_id, 'grade' : self.grade, 'logo_url' : self.logo_url,