def index(request): if request.user.is_authenticated(): favs = Favs.get_list(request.user.key()) else: favs = None return render_to_response('index/index.html',{ 'categories': Category.get_for_lists(), 'hpinfo': SPage.get_by_key_name('hpinfo'), 'new_recipes': Recipe.all().filter('rec_vis =', VISIBILITY[2]).filter('disabled =', False).order('-created').fetch(10), 'pop_recipes': Recipe.all().filter('rec_vis =', VISIBILITY[2]).filter('disabled =', False).order('-views').fetch(10), 'fav_recipes': favs, })
def items(self): return Recipe.all().filter('rec_vis =', VISIBILITY[2]).filter('disabled =', False).order('-created').fetch(200)