def network(request): logger = logging.getLogger(__name__) extra_context = { 'wizard_title': u'2 de 5 - Configuração de Rede', 'page_name': u'network' } if request.method == "GET": interface = NetworkInterface.get_instance() Form = form(NetworkInterface) extra_context['form'] = Form(instance=interface) return render_to_response(request, "generic.html", extra_context) else: edit_singleton_model(request, "generic.html", next_step_url('network'), model=NetworkInterface, extra_context=extra_context) interface = NetworkInterface.get_instance() if interface.address == get_raw_network_interface_address(): return redirect_next_step('network') else: logger.info('redirecting user to redirect page') return render_to_response( request, "redirect.html", dict(ip_address=interface.address, url=next_step_url('network')))
def network(request): logger = logging.getLogger(__name__) extra_context = {'wizard_title': u'2 de 4 - Configuração de Rede', 'page_name': u'network'} if request.method == "GET": interface = NetworkInterface.get_instance() Form = form(NetworkInterface) extra_context['form'] = Form(instance=interface) return render_to_response( request, "generic.html", extra_context) else: edit_singleton_model(request, "generic.html", "nimbus.wizard.views.timezone", model = NetworkInterface, extra_context = extra_context) interface = NetworkInterface.get_instance() if interface.address == get_raw_network_interface_address(): return redirect( "nimbus.wizard.views.timezone" ) else: logger.info('redirecting user to redirect page') return render_to_response(request, "redirect.html", dict(ip_address=interface.address, url=reverse('nimbus.wizard.views.timezone')))
def finish(request): #GET OR POST wizard = models.Wizard.get_instance() wizard.finish() network_interface = NetworkInterface.get_instance() if network_interface.address == get_raw_network_interface_address(): return redirect( "nimbus.base.views.home" ) else: network_interface.save() # change ip address return render_to_response(request, "redirect.html", dict(ip_address=network_interface.address, url="/"))
def finish(request): #GET OR POST wizard = models.Wizard.get_instance() wizard.finish() network_interface = NetworkInterface.get_instance() if network_interface.address == get_raw_network_interface_address(): return redirect("nimbus.base.views.home") else: network_interface.save() # change ip address return render_to_response( request, "redirect.html", dict(ip_address=network_interface.address, url="/"))