Package turbogears :: Module database

Module database

source code

Convenient access to an SQLObject or SQLAlchemy managed database.

Classes
  DatabaseError
  DatabaseConfigurationError
  AutoConnectHub
  PackageHub
  EndTransactionsFilter
Functions
 
create_session_mapper(scoped_session=session) source code
 
get_engine() source code
 
get_metadata() source code
 
bind_metadata() source code
 
create_session() source code
 
set_db_uri(dburi, package=None)
Sets the database URI to use either globally or for a specific package.
source code
 
commit_all()
Commit the transactions in all registered hubs (for this thread).
source code
 
rollback_all()
Rollback the transactions in all registered hubs (for this thread).
source code
 
end_all()
End the transactions in all registered hubs (for this thread).
source code
 
so_to_dict(sqlobj)
Convert SQLObject to a dictionary based on columns.
source code
 
so_columns(sqlclass, columns=None)
Return a dict with all columns from a SQLObject.
source code
 
so_joins(sqlclass, joins=None)
Return a list with all joins from a SQLObject.
source code
Variables
  session_mapper = create_session_mapper()
  mapper = None
hash(x)
  metadata = None
hash(x)
  session = None
hash(x)
Function Details

set_db_uri(dburi, package=None)

source code 

Sets the database URI to use either globally or for a specific package. Note that once the database is accessed, calling setDBUri will have no effect.

Parameters:
  • dburi - database URI to use
  • package - package name this applies to, or None to set the default.

so_columns(sqlclass, columns=None)

source code 

Return a dict with all columns from a SQLObject.

This includes the columns from InheritableSO's bases.

so_joins(sqlclass, joins=None)

source code 

Return a list with all joins from a SQLObject.

The list includes the columns from InheritableSO's bases.