From 6518fa3ff34ec8c305aa08d5569f8b7f13a609fe Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Tue, 16 Jun 2015 23:22:44 +0300 Subject: [PATCH 1/2] courseName is optional --- models/User.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models/User.py b/models/User.py index d59e690..e1edb87 100644 --- a/models/User.py +++ b/models/User.py @@ -12,7 +12,7 @@ class User(db.Model): seToken = db.StringProperty(required=True) avatar_url = db.StringProperty(required=True) isFirstLogin = db.BooleanProperty(default=True) - campusName = db.StringProperty(required=True, default="") + campusName = db.StringProperty(default="") campuses_id_list = db.StringListProperty(default=[]) classes_id_list = db.StringListProperty(default=[]) @@ -24,6 +24,7 @@ class User(db.Model): 'seToken' : self.seToken, 'avatar_url' : self.avatar_url, 'isFirstLogin' : self.isFirstLogin, + 'campusName': self.campusName, 'campuses_id_list': self.campuses_id_list, 'classes_id_list': self.classes_id_list } From ea728b0cc7e1353412b44a3fb6d1e48277068d36 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Tue, 16 Jun 2015 23:23:09 +0300 Subject: [PATCH 2/2] documentation --- SE_API/CourseRoutes.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/SE_API/CourseRoutes.py b/SE_API/CourseRoutes.py index 5713db2..51a54a4 100644 --- a/SE_API/CourseRoutes.py +++ b/SE_API/CourseRoutes.py @@ -42,9 +42,9 @@ def create_course(token): {
'courseName': 'Advance Math',
'campusName': 'JCE',
- 'startDate': '2015-14-3'
- 'endDate': '2015-29-6'
- 'taskFlag': 'False'
+ 'startDate': {'year': 2015, 'month' : 4, 'day' : 3}
+ 'endDate': {'year': 2016, 'month' : 5, 'day' : 14}
+ 'taskFlag': false
}


@@ -67,8 +67,7 @@ def create_course(token): try: payload = json.loads(request.data) except Exception as e: - return bad_request(e) - + return bad_request() try: start_date = datetime.date(payload['startDate']['year'],payload['startDate']['month'],payload['startDate']['day'])