<s> from __future__ import unicode_literals <EOL> import json <EOL> from django . http import HttpResponse <EOL> from django . views . generic import FormView <EOL> class TemplateFormView ( FormView ) : <EOL> template_name = '<STR_LIT>' <EOL> def heavy_data_1 ( request ) : <EOL> term = request . GET . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> numbers = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> numbers = filter ( lambda num : term . lower ( ) in num . lower ( ) , numbers ) <EOL> results = [ { '<STR_LIT:id>' : index , '<STR_LIT:text>' : value } for ( index , value ) in enumerate ( numbers ) ] <EOL> return HttpResponse ( json . dumps ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : results } ) , content_type = '<STR_LIT:application/json>' ) <EOL> def heavy_data_2 ( request ) : <EOL> term = request . GET . get ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> numbers = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> numbers = filter ( lambda num : term . lower ( ) in num . lower ( ) , numbers ) <EOL> results = [ { '<STR_LIT:id>' : index , '<STR_LIT:text>' : value } for ( index , value ) in enumerate ( numbers ) ] <EOL> return HttpResponse ( json . dumps ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : results } ) , content_type = '<STR_LIT:application/json>' ) </s>
