예제 #1
0
	def setPostButton(self, buttons):
		"Determine which button was used to POST the form, if any"
		if not web.hasPostData(): 
			self.postButton = None
			return
		
		for button in buttons:
			if button in form: 
				self.postButton = button
				return
		
		raise Error, "Post data with unknown button."
예제 #2
0
	def isPost(self): return web.hasPostData()
	def isGet(self): os.environ.get("REQUEST_METHOD") == "GET"