Beispiel #1
0
	def get(self):
		lcode = self.request.get('lcode')
		q=Lecturer.all()
		q.filter('__key__ =',Key.from_path('Lecturer',lcode))
		lec = q.get()
		if lec:
			self.response.write(lec.code+' teaches:<br/>')
			for i in lec.modules :
				self.response.write('<br/>--->')
				self.response.write(i.module.code+':'+i.module.title)

		else: self.response.write('Lecturer not found')
Beispiel #2
0
	def get(self):
		mcode = self.request.get('mcode')
		lcode = self.request.get('lcode')
		
		q=Lecturer.all()
		q.filter('__key__ =', Key.from_path('Lecturer', lcode))
		lecturers = q.get()
		self.response.write('Lecturer with code "'+lcode+'" is called "'+lecturers.full_name+'"')
		
		q = Module.all()
		q.filter('__key__ = ', Key.from_path('Module',mcode))
		modules = q.get()
		self.response.write('<br/>Module with code "'+modules.code+'" has title "'+modules.title+'"')
		
		Rating(module=modules, lecturer =lecturers).put()
		self.response.write('<br/> Rating probably put successfully')
Beispiel #3
0
def reset_db():
    for user in User.all(): user.delete()

    for ycs in YearCourseSemester.all(): ycs.delete()

    for mod in Module.all(): mod.delete()

    for sub in Subscription.all(): sub.delete()

    for sub in Category.all(): sub.delete()

    for i in Thread.all(): i.delete()

    for i in Post.all(): i.delete()

    for i in Rating.all(): i.delete()

    for i in Assessment.all(): i.delete()

    for i in Grade.all(): i.delete()

    for i in Lecturer.all(): i.delete()

    for i in LecturerRating.all(): i.delete()