Exemplo n.º 1
0
 def poor_recipes(self, request):
     if request.user.is_anonymous:
         return JsonResponse(
             {'message': 'Must be logged in to get poor recipe list!'},
             status=status.HTTP_403_FORBIDDEN)
     return JsonResponse(
         {'poor_recipes': Recipe.get_poor_recipes(request.user.id)})
Exemplo n.º 2
0
 def handle(self, *args, **options):
     for recipe in Recipe.get_poor_recipes():
         print("Found dumb recipe: %s" % recipe.title)