Exemple #1
0
	def get(self, cook):
		user = User.is_logged(self)
		author = User.all().filter('nickname =', cook.lower()).fetch(1)

		if not len( author ):
			self.error(404)
			return

		author = author[0]
			
		if user:
			alreadyfollow = Friendship.alreadyfollow( user, author  )
		
		title = "%s's CookBook" %(author.nickname)
		subhead = "Discover what %s has shared"  % (author.nickname)
		author_recipes_count = Koch.all().filter('author =', author).count();
		

		if author.fb_profile_url:
			avatar = "https://graph.facebook.com/%s/picture" % (author.nickname)
		elif not author.usegravatar and author.avatar:
			avatar = "/avatar/?user_id=%s" %(author.key())
		else:
			avatar = helpers.get_gravatar( author.email, 90 )
		
		page = self.request.get_range('page', min_value=0, max_value=1000, default=0)
  		tmp_kochs, next_page, prev_page = helpers.paginate( Koch.all().filter('author =', author).order('-created'), page ) 
		kochs = helpers.get_kochs_data(tmp_kochs)
		last_kochs = Koch.all().filter('author =', author).order('-created').fetch(5);
		last_from_all = Koch.get_random()
		current = "explore"
		self.response.out.write(template.render('templates/list_kochs.html', locals()))
Exemple #2
0
	def get(self):
		user = User.is_logged(self)
		page = self.request.get_range('page', min_value=0, max_value=1000, default=0)
		title = "Explore Recipes"
		subtitle = ""
		subhead = "You can find hidden treasures."
		current = "explore"
  		tmp_kochs, next_page, prev_page = helpers.paginate( Koch.all().order('-created'), page )
		kochs = helpers.get_kochs_data(tmp_kochs)
		last_from_all = Koch.get_random()
		self.response.out.write(template.render('templates/list_kochs.html', locals()))