예제 #1
0
파일: views.py 프로젝트: wapcaplet/vittles
def index(request):
    """Cookbook homepage.
    """
    variables = {
        'recipe_categories': group_by_category(Recipe.objects.all()),
    }
    return render_to_response('cookbook/index.html', variables)
예제 #2
0
파일: models.py 프로젝트: wapcaplet/vittles
 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())