Ejemplo n.º 1
0
	def incrementDailyNewUser(self):
		today = datetime.date.today()
		records = db.GqlQuery("SELECT * FROM DailyNewUsers WHERE date=DATETIME(:year, :month, :day, 0, 0, 0) AND os=:os AND os_ver=:os_ver AND app_ver=:app_ver", year=today.year, month=today.month, day=today.day, os=self.os, os_ver=self.os_ver, app_ver=self.app_ver)
		count = 0
		for record in records:
			count += 1
			record.total = record.total + 1
			record.put()
		if count==0:
			user = DailyNewUsers()
			user.total = 1
			user.os = self.os
			user.os_ver = self.os_ver
			user.app_ver = self.app_ver
			user.put()