예제 #1
0
파일: views.py 프로젝트: gluwer/przepisymm
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,
  })
예제 #2
0
 def items(self):
   return Recipe.all().filter('rec_vis =', VISIBILITY[2]).filter('disabled =', False).order('-created').fetch(200)