<s> from django . shortcuts import get_object_or_404 <EOL> from django . shortcuts import render <EOL> from core . network . models import Network <EOL> from core . network . utils import calc_networks <EOL> from core . network . forms import NetworkForm <EOL> from core . views import ( CoreDeleteView , CoreListView , CoreUpdateView , <EOL> CoreCreateView ) <EOL> class NetworkView ( object ) : <EOL> model = Network <EOL> queryset = Network . objects . select_related ( '<STR_LIT>' ) . all ( ) <EOL> form_class = NetworkForm <EOL> class NetworkDeleteView ( NetworkView , CoreDeleteView ) : <EOL> pass <EOL> class NetworkListView ( NetworkView , CoreListView ) : <EOL> template_name = '<STR_LIT>' <EOL> class NetworkUpdateView ( NetworkView , CoreUpdateView ) : <EOL> template_name = '<STR_LIT>' <EOL> class NetworkCreateView ( NetworkView , CoreCreateView ) : <EOL> pass <EOL> def network_detail ( request , network_pk ) : <EOL> network = get_object_or_404 ( Network , pk = network_pk ) <EOL> network . update_network ( ) <EOL> attrs = network . keyvalue_set . all ( ) <EOL> eldars , sub_networks = calc_networks ( network ) <EOL> ranges = network . range_set . all ( ) <EOL> return render ( request , '<STR_LIT>' , { <EOL> '<STR_LIT>' : network , <EOL> '<STR_LIT>' : ranges , <EOL> '<STR_LIT>' : eldars , <EOL> '<STR_LIT>' : sub_networks , <EOL> '<STR_LIT>' : attrs , <EOL> } ) </s>
