pyramid_zodbconn API¶
-
pyramid_zodbconn.includeme(config, db_from_uri=<function db_from_uri>)¶ This includeme recognizes a
zodbconn.urisetting in your deployment settings and creates a ZODB database if it finds one.zodbconn.uriis the database URI or URIs (either a whitespace-delimited string, a carriage-return-delimed string or a list of strings).Database is activated with ZODB.ActivityMonitor.ActivityMonitor.
It will also recognize named database URIs as long as an unnamed database is in the configuration too:
zodbconn.uri.sessions = file:///home/project/var/Data.fs
-
pyramid_zodbconn.get_connection(request, dbname=None)¶ requestmust be a Pyramid request object.When called with no
dbnameargument or adbnameargument ofNone, return a connection to the primary datbase (the database set up aszodbconn.uriin the current configuration).If you’re using named databases, you can obtain a connection to a named database by passing its name as
dbname. It must be the name of a database (e.g. if you’ve addedzodbconn.uri.footo the configuration, it should befoo).