def index(request): """ Renders the home page. """ return render( request, 'website/index.html', { 'grid': Grid.get_if_exists('index') } )
def grid(context, grid_id): """ Renders the grid of the given ID. This block simply outputs the blocks instanced in the grid in sequence; you will generally want to ensure that your grid CSS automatically breaks the grid stream into rows and columns. :param grid_id: the ID (name or primary key) of the grid :type grid_id: string, integer or `GridBlock` :rtype: a template tag node """ # As grid_block and for the same reasons, but obviously with # 'grid' instead of 'box'. context['grid'] = Grid.get_if_exists(grid_id) context['grid_id'] = grid_id return context