removed project list from course and added course to project

This commit is contained in:
Aran Zaiger 2015-06-15 18:34:02 +03:00
parent f5cac61856
commit ab4cdab12d
2 changed files with 4 additions and 2 deletions

View file

@ -7,7 +7,7 @@ class Course(db.Model):
courseName = db.StringProperty(required=True) courseName = db.StringProperty(required=True)
campusName = db.StringProperty(required=True) campusName = db.StringProperty(required=True)
master_id = db.IntegerProperty(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) startDate = db.DateProperty(required=True)
endDate = db.DateProperty(required=True) endDate = db.DateProperty(required=True)
@ -15,7 +15,7 @@ class Course(db.Model):
data = {'courseName' : self.courseName, data = {'courseName' : self.courseName,
'campusName' : self.campusName, 'campusName' : self.campusName,
'master_id' : self.master_id, 'master_id' : self.master_id,
'projects' : self.projects, # 'projects' : self.projects,
'startDate' : { 'startDate' : {
'year': self.startDate.year, 'year': self.startDate.year,
'month': self.startDate.month, 'month': self.startDate.month,

View file

@ -5,6 +5,7 @@ from google.appengine.ext import db
class Project(db.Model): class Project(db.Model):
projectName = db.StringProperty(required=True) projectName = db.StringProperty(required=True)
courseName = db.StringProperty(required=True)
master_id = db.IntegerProperty(required=True) master_id = db.IntegerProperty(required=True)
grade = db.IntegerProperty(required=True, default=0) grade = db.IntegerProperty(required=True, default=0)
logo_url = db.StringProperty(required=False) logo_url = db.StringProperty(required=False)
@ -13,6 +14,7 @@ class Project(db.Model):
def to_JSON(self): def to_JSON(self):
data = {'projectName' : self.projectName, data = {'projectName' : self.projectName,
'courseName' : self.courseName,
'master_id' : self.master_id, 'master_id' : self.master_id,
'grade' : self.grade, 'grade' : self.grade,
'logo_url' : self.logo_url, 'logo_url' : self.logo_url,