dataimport.py
changeset 9904 2205c5e1edc2
parent 9902 62c586f32f93
child 9905 1fa35cc06c69
equal deleted inserted replaced
9903:d1fdbdbab194 9904:2205c5e1edc2
   620 
   620 
   621 class RQLObjectStore(ObjectStore):
   621 class RQLObjectStore(ObjectStore):
   622     """ObjectStore that works with an actual RQL repository (production mode)"""
   622     """ObjectStore that works with an actual RQL repository (production mode)"""
   623     _rql = None # bw compat
   623     _rql = None # bw compat
   624 
   624 
   625     def __init__(self, session=None, commit=None):
   625     def __init__(self, session, commit=None):
   626         ObjectStore.__init__(self)
   626         ObjectStore.__init__(self)
   627         if session is None:
       
   628             sys.exit('please provide a session of run this script with cubicweb-ctl shell and pass cnx as session')
       
   629         if not hasattr(session, 'set_cnxset'):
   627         if not hasattr(session, 'set_cnxset'):
   630             if hasattr(session, 'request'):
   628             if hasattr(session, 'request'):
   631                 # connection object
   629                 # connection object
   632                 cnx = session
   630                 cnx = session
   633                 session = session.request()
   631                 session = session.request()