def instructors(self): from instructor import Instructor last = self.prime.split(',')[0] first = self.prime.split() if len(first) > 1: first = first[1] else: first = None prime = Instructor.query(ancestor = self.key).filter(ndb.AND(Instructor.last == last, Instructor.first == first)).get() ret = [] if prime: ret.append(prime) instructors_list = Instructor.query(ancestor = self.key).order(Instructor.last).fetch() for i in instructors_list: if i != prime: ret.append(i) return ret
def savedInstructors(self): from instructor import Instructor return Instructor.query(ancestor = self.key).filter(Instructor.onSyllabus == False).order(Instructor.last).fetch()