#NEWLINE# def weekFilter( queryset , querydict ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# week = querydict [ 'week' ] #NEWLINE# if ( week . upper ( ) == 'NOW' ) : #NEWLINE# #INDENT# queryset = queryset . filter ( cycle_week_number = get_week_number ( date . today ( ) ) ) #NEWLINE# #UNINDENT# if ( week . upper ( ) == 'LAST' ) : #NEWLINE# #INDENT# queryset = queryset . filter ( cycle_week_number = ( get_week_number ( date . today ( ) ) - 1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return queryset