From 7bb9bb9bfbe0e9de8571970866d11294a0d3aa90 Mon Sep 17 00:00:00 2001 From: aranzaiger Date: Sun, 21 Jun 2015 22:19:49 +0300 Subject: [PATCH] Added get_campus_by_campusName function --- SE_API/Validation_Utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SE_API/Validation_Utils.py b/SE_API/Validation_Utils.py index 90df681..56da380 100644 --- a/SE_API/Validation_Utils.py +++ b/SE_API/Validation_Utils.py @@ -13,6 +13,14 @@ def get_user_by_token(token): return u return None +def get_campus_by_campusName(campusName): + query = Campus.all() + query.filter("title = ", campusName) + + for u in query.run(limit = 1): + return u + return None + def get_campus_by_suffix(suffix): query = Campus.all() query.filter("email_ending = ", suffix)