@app.route('/accounts/')
def ns_all():
 with global_session_scope() as db_session:
  parser = reqparse.RequestParser(argument_class=ValidatableArgument)
  parser.add_argument('limit', default=DEFAULT_LIMIT, type=limit, location='args')
  parser.add_argument('offset', default=0, type=int, location='args')
  parser.add_argument('email_address', type=bounded_str, location='args')
  args = strict_parse_args(parser, request.args)
  query = db_session.query(Namespace)
  if args['email_address']:
   query = query.join(Account)
   query = query.filter_by(email_address=args['email_address'])
  query = query.limit(args['limit'])
  if args['offset']:
   query = query.offset(args['offset'])
  namespaces = query.all()
  encoder = APIEncoder()
  return encoder.jsonify(namespaces)

@ app . route ( '/accounts/' ) def ns_all ( ) : with global_session_scope ( ) as db_session : parser = reqparse . RequestParser ( argument_class = ValidatableArgument ) parser . add_argument ( 'limit' , default = DEFAULT_LIMIT , type = limit , location = 'args' ) parser . add_argument ( 'offset' , default = 0 , type = int , location = 'args' ) parser . add_argument ( 'email_address' , type = bounded_str , location = 'args' ) args = strict_parse_args ( parser , request . args ) query = db_session . query ( Namespace ) if args [ 'email_address' ] : query = query . join ( Account ) query = query . filter_by ( email_address = args [ 'email_address' ] ) query = query . limit ( args [ 'limit' ] ) if args [ 'offset' ] : query = query . offset ( args [ 'offset' ] ) namespaces = query . all ( ) encoder = APIEncoder ( ) return encoder . jsonify ( namespaces )
return all namespaces .