def edit(self, id):
        """ Edit a pool.
        """

        c.pool = Pool.get(int(id))
        c.prefix_list = Prefix.list({ 'pool_id': c.pool.id })
        c.prefix = ''

        # save changes to NIPAP
        if request.method == 'POST':
            c.pool.name = request.params['name']
            c.pool.description = request.params['description']
            c.pool.default_type = request.params['default_type']
            if request.params['ipv4_default_prefix_length'].strip() == '':
                c.pool.ipv4_default_prefix_length = None
            else:
                c.pool.ipv4_default_prefix_length = request.params['ipv4_default_prefix_length']
            if request.params['ipv6_default_prefix_length'].strip() == '':
                c.pool.ipv6_default_prefix_length = None
            else:
                c.pool.ipv6_default_prefix_length = request.params['ipv6_default_prefix_length']
            c.pool.save()
            redirect(url(controller = 'pool', action = 'list'))

        c.search_opt_parent = 'all'
        c.search_opt_child = 'none'

        return render("/pool_edit.html")