<s> from django . shortcuts import render , get_object_or_404 <EOL> from . models import Country <EOL> from . forms import CountrySearchForm <EOL> def country_list ( request ) : <EOL> countries = Country . objects . all ( ) <EOL> form = CountrySearchForm ( request . GET or None ) <EOL> if form . is_valid ( ) : <EOL> countries = Country . objects . search ( ** form . cleaned_data ) <EOL> return render ( request , "<STR_LIT>" , <EOL> { "<STR_LIT>" : countries , '<STR_LIT>' : form } ) <EOL> def country_detail ( request , pk ) : <EOL> country = get_object_or_404 ( Country , pk = pk ) <EOL> return render ( request , "<STR_LIT>" , <EOL> { "<STR_LIT>" : country } ) </s>
