def grid_one(request, year=datetime.now().year, month=datetime.now().month, day=None, calendar_slug=None, page=1):
    """
    Shows a grid (similar in appearance to a physical calendar) of upcoming events for either a specific calendar or no 
    calendar at all.
    """
    try:
        page = int(page)
        if year:
            year = int(year)
        if month:
            month = int(month)
    except __HOLE__:
        raise Http404
    
    calendar = None
    calendar_list = Calendar.objects.all().order_by('name')
    events = Event.objects.all()
    if calendar_slug:
        calendar = get_object_or_404(Calendar, slug=calendar_slug)
        events = events.filter(calendars=calendar)

    month_formatted = pycal.monthcalendar(year, month)

    month_minus = month - 1

    month_plus = month + 1

    month_name = pycal.month_name[month]

    weekday_header = pycal.weekheader(3).strip().split(" ")

    year_minus = year - 1

    year_plus = year + 1

    today = datetime.now().day

    this_month = datetime.now().month

    this_year = datetime.now().year

    event_list = events.filter(Q(start__year=year, start__month=month) | Q(end__year=year, end__month=month))
    page_name = "This is a test of the calendaring system."

    page = {
        'calendar': calendar,
        'calendar_list': calendar_list,
        'event_list': event_list,
        'month': month,
        'month_formatted': month_formatted,
        'month_minus': month_minus,
        'month_name': month_name,
        'month_plus': month_plus,
        'page_name': page_name,
        'this_month': this_month,
        'this_year': this_year,
        'today': today,
        'weekday_header': weekday_header,
        'year': year,
        'year_minus': year_minus,
        'year_plus': year_plus,
    }
    
    return render_to_response('events/gridiron.html', page, context_instance=RequestContext(request))
dataset/ETHPy150Open albatrossandco/brubeck_cms/brubeck/events/views.py/grid_one