<s> from django . template import Library , Node <EOL> from feedback . models import Feedback <EOL> register = Library ( ) <EOL> @ register . inclusion_tag ( "<STR_LIT>" , takes_context = True ) <EOL> def show_feedback ( context , feedback ) : <EOL> return { '<STR_LIT>' : feedback , '<STR_LIT>' : context [ '<STR_LIT>' ] } <EOL> @ register . simple_tag <EOL> def clear_search_url ( request ) : <EOL> getvars = request . GET . copy ( ) <EOL> if '<STR_LIT>' in getvars : <EOL> del getvars [ '<STR_LIT>' ] <EOL> if len ( getvars . keys ( ) ) > <NUM_LIT:0> : <EOL> return "<STR_LIT>" % ( request . path , getvars . urlencode ( ) ) <EOL> else : <EOL> return request . path <EOL> @ register . simple_tag <EOL> def persist_getvars ( request ) : <EOL> getvars = request . GET . copy ( ) <EOL> if len ( getvars . keys ( ) ) > <NUM_LIT:0> : <EOL> return "<STR_LIT>" % getvars . urlencode ( ) <EOL> return '<STR_LIT>' </s>
