#NEWLINE# @ register . filter #NEWLINE# def week_number( date ) : #NEWLINE# #INDENT# '\n    Return the Python week number of a date.\n    The django \\|date:"W" returns incompatible value\n    with the view implementation.\n    ' #NEWLINE# week_number = date . strftime ( '%W' ) #NEWLINE# if ( int ( week_number ) < 10 ) : #NEWLINE# #INDENT# week_number = date [ ( - 1 ) ] #NEWLINE# #UNINDENT# return week_number