Advertisement
Guest User

Untitled

a guest
May 6th, 2016
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PyCon 0.65 KB | None | 0 0
  1. def list_request(request, function_name, args=list()):
  2.     if request.COOKIES.has_key('connection'):
  3.         current_connection = request.COOKIES['connection']
  4.     else:
  5.         current_connection = 'default'
  6.  
  7.     try:
  8.         cursor = connections[current_connection].cursor()
  9.         print(connections[current_connection].connection.username)
  10.         client_cursor = cursor.callfunc(execute_function(function_name), cx_Oracle.CURSOR, args)
  11.  
  12.         data = client_cursor.fetchall()
  13.         row_names = _get_row_names(client_cursor.description)
  14.  
  15.         return row_names, data
  16.     except cx_Oracle.DatabaseError:
  17.         raise AccessDeniedError()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement