Beispiel #1
0
def index(request):
    """Cookbook homepage.
    """
    variables = {
        'recipe_categories': group_by_category(Recipe.objects.all()),
    }
    return render_to_response('cookbook/index.html', variables)
Beispiel #2
0
 def ingredient_groups(self):
     """Return a list of ``(category, [ingredients])`` for this recipe.
     ``category`` is ``None`` for any ingredients without a defined category.
     """
     return group_by_category(self.ingredients.all())