def list_prefix(self):
        """ List prefixes and return JSON encoded result.
        """

        # fetch attributes from request.json
        attr = XhrController.extract_prefix_attr(request.json)

        try:
            prefixes = Prefix.list(attr)
        except NipapError, e:
            return json.dumps({'error': 1, 'message': e.args, 'type': type(e).__name__})

        return json.dumps(prefixes, cls=NipapJSONEncoder)
def list_prefix ( self ) : attr = XhrController . extract_prefix_attr ( request . json ) try : prefixes = Prefix . list ( attr ) except NipapError , e : return json . dumps ( { 'error' : 1 , 'message' : e . args , 'type' : type ( e ) . __name__ } ) return json . dumps ( prefixes , cls = NipapJSONEncoder )
List prefixes and return JSON encoded result.