<class 'cx_Oracle.DatabaseError'>
Python 2.7.5: /usr/bin/python
Sun Apr 30 21:43:59 2017

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/sites/tsdavo.org.ua/htdocs/src/index.py in ()
    187                                 result = template("page").merge({
    188                                                 "menu": get_menu_data(params, model),
=>  189                                                 "page": get_page_data(params, mode, model),
    190                                                 "left_menu": model.get_leftmenu(),
    191                                                 "top_menu": model.get_topmenu(),
get_page_data = <function get_page_data>, params = ['orgs', 'index'], mode = FieldStorage(None, None, []), model = <model.Model instance>
 /home/sites/tsdavo.org.ua/htdocs/src/index.py in get_page_data(params=['orgs', 'index'], mode=FieldStorage(None, None, []), model=<model.Model instance>)
    129                 return { "persons": model.get_persons(page=get_page()) }
    130         elif match("orgs"):
=>  131                 return { "orgs": model.get_orgs(page=get_page()) }
    132         elif match("stocks"):
    133                 return { "title": model.name("STOCKS"),
model = <model.Model instance>, model.get_orgs = <bound method Model.get_orgs of <model.Model instance>>, page undefined, get_page = <function get_page>
 /home/sites/tsdavo.org.ua/htdocs/src/model.py in get_orgs(self=<model.Model instance>, id_list=None, page=0, page_size=120)
    318                 return ObjectList(self.connection(),
    319                                 ("SELECT id, name# as name FROM subjindex ORDER BY sort_name#").replace("#", self.language["id"]),
=>  320                                 page, page_size, 2, id_list=id_list)
    321         def get_org(self, oid):
    322                 return self.get_orgs([oid])[0][0]
page = 0, page_size = 120, id_list = None
 /home/sites/tsdavo.org.ua/htdocs/src/model.py in __init__(self=<model.ObjectList instance>, conn=<cx_Oracle.Connection to KIEV_READER@orcl>, select='SELECT id, name4 as name FROM subjindex ORDER BY sort_name4', page=0, page_size=120, cols_count=2, proc=<function <lambda>>, id_list=None, id_query=None)
    133                                 cur.execute("select * from (" + select + ") where " + ((ids and ("id in (" + ", ".join(ids) + ")")) or "id<0") )
    134                         else:
=>  135                                 cur.execute("select * from (" + select + ") where row_num<=" + str((page+1)*page_size) + " AND row_num>"  + str(page*page_size) + " ORDER BY row_num")
    136                         columns = cur.description
    137                         for r in cur:
cur = <cx_Oracle.Cursor on <cx_Oracle.Connection to KIEV_READER@orcl>>, cur.execute = <built-in method execute of cx_Oracle.Cursor object>, select = 'SELECT id, name4 as name FROM subjindex ORDER BY sort_name4', builtin str = <type 'str'>, page = 0, page_size = 120

<class 'cx_Oracle.DatabaseError'>: ORA-00904: "ROW_NUM": invalid identifier
      args = (<cx_Oracle._Error object>,)
      message = <cx_Oracle._Error object>