<s> from django import template <EOL> register = template . Library ( ) <EOL> @ register . inclusion_tag ( '<STR_LIT>' , takes_context = True ) <EOL> def pagination ( context , objects ) : <EOL> request = context [ '<STR_LIT>' ] <EOL> return { '<STR_LIT>' : objects , '<STR_LIT>' : request } <EOL> @ register . simple_tag ( takes_context = True ) <EOL> def set_page_query ( context , page ) : <EOL> query = context [ '<STR_LIT>' ] . GET . copy ( ) <EOL> query [ '<STR_LIT>' ] = page <EOL> return query . urlencode ( ) </s>
