server/__init__.py
changeset 4831 c5aec27c1bf7
parent 4766 162b2b127b15
child 4834 b718626a0e60
equal deleted inserted replaced
4829:3b79a0fc91db 4831:c5aec27c1bf7
   143             sqlcnx.rollback()
   143             sqlcnx.rollback()
   144     # schema entities and relations tables
   144     # schema entities and relations tables
   145     # can't skip entities table even if system source doesn't support them,
   145     # can't skip entities table even if system source doesn't support them,
   146     # they are used sometimes by generated sql. Keeping them empty is much
   146     # they are used sometimes by generated sql. Keeping them empty is much
   147     # simpler than fixing this...
   147     # simpler than fixing this...
   148     if sqlcnx.logged_user != source['db-user']:
   148     schemasql = sqlschema(schema, driver)
   149         schemasql = sqlschema(schema, driver, user=source['db-user'])
   149     #skip_entities=[str(e) for e in schema.entities()
   150     else:
   150     #               if not repo.system_source.support_entity(str(e))])
   151         schemasql = sqlschema(schema, driver)
       
   152         #skip_entities=[str(e) for e in schema.entities()
       
   153         #               if not repo.system_source.support_entity(str(e))])
       
   154     sqlexec(schemasql, execute, pbtitle=_title)
   151     sqlexec(schemasql, execute, pbtitle=_title)
   155     sqlcursor.close()
   152     sqlcursor.close()
   156     sqlcnx.commit()
   153     sqlcnx.commit()
   157     sqlcnx.close()
   154     sqlcnx.close()
   158     session = repo.internal_session()
   155     session = repo.internal_session()
   235     if changes:
   232     if changes:
   236         config.disable_hook_category(changes)
   233         config.disable_hook_category(changes)
   237     config.set_hooks_mode(oldmode)
   234     config.set_hooks_mode(oldmode)
   238 
   235 
   239 
   236 
   240 # sqlite'stored procedures have to be registered at connexion opening time
   237 # sqlite'stored procedures have to be registered at connection opening time
   241 SQL_CONNECT_HOOKS = {}
   238 from logilab.db import SQL_CONNECT_HOOKS
   242 
   239 
   243 # add to this set relations which should have their add security checking done
   240 # add to this set relations which should have their add security checking done
   244 # *BEFORE* adding the actual relation (done after by default)
   241 # *BEFORE* adding the actual relation (done after by default)
   245 BEFORE_ADD_RELATIONS = set(('owned_by',))
   242 BEFORE_ADD_RELATIONS = set(('owned_by',))
   246 
   243