#NEWLINE# def formatmonth( self , theyear , themonth , withyear = True , net = None , qs = None , template = 'happenings/partials/calendar/month_table.html' ) : #NEWLINE# #INDENT# 'Return a formatted month as a table.' #NEWLINE# context = self . get_context ( ) #NEWLINE# context [ 'month_start_date' ] = date ( self . yr , self . mo , 1 ) #NEWLINE# context [ 'week_rows' ] = [ ] #NEWLINE# for week in self . monthdays2calendar ( theyear , themonth ) : #NEWLINE# #INDENT# week_row = [ ] #NEWLINE# for ( day , weekday ) in week : #NEWLINE# #INDENT# week_row . append ( self . formatday ( day , weekday ) ) #NEWLINE# #UNINDENT# context [ 'week_rows' ] . append ( week_row ) #NEWLINE# #UNINDENT# ( nxt , prev ) = get_next_and_prev ( net ) #NEWLINE# extra_qs = ( ( '&' + '&' . join ( qs ) ) if qs else '' ) #NEWLINE# context [ 'prev_qs' ] = mark_safe ( ( '?cal_prev=%d%s' % ( prev , extra_qs ) ) ) #NEWLINE# context [ 'next_qs' ] = mark_safe ( ( '?cal_next=%d%s' % ( nxt , extra_qs ) ) ) #NEWLINE# context [ 'withyear' ] = withyear #NEWLINE# return render_to_string ( template , context )