Changeset - cdf95f86ba07
[Not reviewed]
default
0 1 0
Branko Majic (branko) - 13 years ago 2013-02-19 21:10:37
branko@majic.rs
Forgot to provide all ingredients on the user's page.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
djangoshaker/views.py
Show inline comments
 
@@ -58,12 +58,14 @@ class UserView(TemplateView):
 
            for recipe in Recipe.objects.all():
 
                recipe_ingredients = set([recing.ingredient_id for recing in recipe.recipeingredient_set.all()])
 
                if recipe_ingredients.issubset(user_ingredients):
 
                    print recipe.name
 
                    available_recipes.append(recipe)
 
            context['available_recipes'] = available_recipes
 
        else:
 
            context['ingredients'] = Ingredient.objects.all()
 

	
 
        return context
 

	
 
def add_user_ingredient(request, ingredient_id):
 
    ingredient = get_object_or_404(Ingredient, pk = ingredient_id)
 

	
0 comments (0 inline, 0 general)