예제 #1
0
	def get(self):
		r = TempProphecy.all().fetch(1000)
		for p in r:
			np = Prophecy(key_name=str(p.languageid) + '-' + str(p.day))
			np.day = p.day 
			np.rune_title = p.rune_title
			np.rune_subtitle = p.rune_subtitle
			np.day_of_month = p.day_of_month
			np.description = p.description
			np.languageid = p.languageid
			np.put()
예제 #2
0
	def get(self):
		locale = self.request.get('lang_id')
		if locale == '':
			locale = 'is'
		
		lines = self.request.get('lines')
		logging.debug('Number of lines: ' + str(lines))
	
		datearray = list()
		namearray = list()
		#Format is lang-monthday
		for j in range(int(lines)):
			logging.debug('Iteration number: ' + str(j))
			datearray.append(self.request.get('lang_' + str(j))+'-'+self.request.get('mon_' + str(j))+self.request.get('day_' + str(j)))
			namearray.append(self.request.get('name_' + str(j)))

		logging.debug('Checking date array: ')
		logging.debug(datearray)
		logging.info('Fetching ' + str(len(namearray)) + ' documents')

		days = Prophecy.get_by_key_name(datearray)
		dl = list()
		for i in range(len(days)):
			logging.debug('Iteration: ' + str(i))
			logging.debug('Days range: ' + str(len(days)))
			d = {
			'day': days[i].day,
			'rune_title': days[i].rune_title,
			'rune_subtitle': days[i].rune_subtitle,
			'god': days[i].god,
			'day_of_month': days[i].day_of_month,
			'description': days[i].description.replace('\\r\\n','<br/>'),
			'languageid': days[i].languageid,
			'name':namearray[i],
			'calendar_day': int(days[i].day[2:4]),
			'calendar_month': getmonthname(days[i].day[0:2],datearray[i][0:2]),
			'locale': locale
			}
			dl.append(d)
			
		if lines == '2':
			lines = '12'

		if lines == '3':
			lines = '123'
		
		template_values = {
			'lines': lines,
			'days': dl,
			'strings' : getstrings(locale)
		}
		
		path = os.path.join(os.path.dirname(__file__), 'views/step2.html')
		self.response.out.write(template.render(path, template_values))