def list_prefix(self, auth, spec = None):
self._logger.debug("<STR_LIT>" % unicode(spec))<EOL>if type(spec) is dict:<EOL><INDENT>where, params = self._expand_prefix_spec(spec.copy(), '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>raise NipapError("<STR_LIT>")<EOL><DEDENT>if where != '<STR_LIT>':<EOL><INDENT>where = '<STR_LIT>' + where<EOL><DEDENT>sql = """<STR_LIT>""" % where<EOL>self._execute(sql, params)<EOL>res = list()<EOL>for row in self._curs_pg:<EOL><INDENT>pref = dict(row)<EOL>pref['<STR_LIT>'] = unicode(pref['<STR_LIT>'])<EOL>res.append(pref)<EOL><DEDENT>return res<EOL>
List prefixes matching the `spec`.

            * `auth` [BaseAuth]
                AAA options.
            * `spec` [prefix_spec]
                Specifies prefixes to list. If omitted, all will be listed.

            Returns a list of dicts.

            This is a quite blunt tool for finding prefixes, mostly useful for
            fetching data about a single prefix. For more capable alternatives,
            see the :func:`search_prefix` or :func:`smart_search_prefix` functions.

            This is the documentation of the internal backend function. It's
            exposed over XML-RPC, please also see the XML-RPC documentation for
            :py:func:`nipap.xmlrpc.NipapXMLRPC.list_prefix` for full
            understanding.