def list_prefix(self, auth, spec = None):

        self._logger.debug("list_prefix called; spec: %s" % str(spec))


        if type(spec) is dict:
            where, params = self._expand_prefix_spec(spec.copy(), 'inp.')
        else:
            raise NipapError("invalid prefix specification")

        if where != '':
            where = ' WHERE ' + where

        sql = """SELECT
            inp.id,
            vrf.id AS vrf_id,
            vrf.rt AS vrf_rt,
            vrf.name AS vrf_name,
            family(prefix) AS family,
            inp.prefix,
            inp.display_prefix,
            inp.description,
            COALESCE(inp.inherited_tags, '{}') AS inherited_tags,
            COALESCE(inp.tags, '{}') AS tags,
            inp.node,
            inp.comment,
            pool.id AS pool_id,
            pool.name AS pool_name,
            inp.type,
            inp.indent,
            inp.country,
            inp.order_id,
            inp.customer_id,
            inp.external_key,
            inp.authoritative_source,
            inp.alarm_priority,
            inp.monitor,
            inp.vlan,
            inp.added,
            inp.last_modified,
            inp.total_addresses,
            inp.used_addresses,
            inp.free_addresses,
            inp.status,
            inp.avps,
            inp.expires
            FROM ip_net_plan inp
            JOIN ip_net_vrf vrf ON (inp.vrf_id = vrf.id)
            LEFT JOIN ip_net_pool pool ON (inp.pool_id = pool.id) %s
            ORDER BY vrf.rt NULLS FIRST, prefix""" % where

        self._execute(sql, params)

        res = list()
        for row in self._curs_pg:
            pref = dict(row)
            pref['display_prefix'] = str(pref['display_prefix'])
            res.append(pref)

        return res
Get the current user if available, else None.
dataset/ETHPy150Open SpriteLink/NIPAP/nipap/nipap/backend.py/Nipap.list_prefix--crossover with--dataset/ETHPy150Open heiskr/sagefy/server/framework/session.py/get_current_user