Пример #1
0
	def get(self):
		mcode = self.request.get('code')
		mtitle = self.request.get('title')
		mc = self.request.get('mc')
		my = self.request.get('my')
		ms = self.request.get('ms')
		murl = self.request.get('murl')

		q = YearCourseSemester.all()
		q.filter('course =',mc)
		q.filter('year =',int(my))
		q.filter('semester =',int(ms))
		ycsa = q.get()

		Module(key_name=mcode, code=mcode,title=mtitle,home_page=murl, semester=int(ms), ycs = ycsa).put()
		self.response.write('Put module probably successful')
Пример #2
0
	def get(self) :
		y = self.request.get('year')
		s = self.request.get('semester')
		crs = self.request.get('course')
		yr = int(y)
		sm = int(s)

		q = YearCourseSemester.all()
		q.filter('course =',crs)
		q.filter('year =',yr)
		q.filter('semester =',sm)

		ycs = q.get()
		if ycs :
			self.response.write('Found YCS object, printing  modules.<br/>')

			for i in ycs.modules :
				self.response.write(i.code+':'+i.title+'<br/>')
		else : self.response.write('Unable to find YCS entity')
Пример #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()