Ejemplo n.º 1
0
	def msgSortMark(self,ids,sort_id):
		repo = WeixinDB()
		create_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
		count = 0
		with repo:
			for msg_id in ids:
				try:
					sql_str = 'update approve_metadata set sort_id = %d where id = %d ' % (sort_id,msg_id)
					repo.execute_query(sql_str)
					count = count + 1
				except Exception, e:
					print e
					print ' at %s' % (create_time)
Ejemplo n.º 2
0
	def gen_query_number(self,sql_str):
		result = 0
		create_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
		repo = WeixinDB()
		with repo:
			try:
				query_tuple = repo.execute_query(sql_str)
			except Exception, e:
				print e
				print 'at %s ' % (create_time)
			else:
Ejemplo n.º 3
0
	def gen_query_tuple(self,sql_str,*param):
		count = 0
		result = list()
		create_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
		repo = WeixinDB()
		with repo:
			try:
				query_tuple = repo.execute_query(sql_str,param[0]) 
			except Exception, e:
				print e
				print ' at %s' % (create_time)
			else: