boardinghouse.schema module

boardinghouse.schema.REQUIRED_SHARED_MODELS = ['auth.user', 'auth.permission', 'auth.group', 'boardinghouse.schema', 'sites.site', 'sessions.session', 'contenttypes.contenttype', 'admin.logentry', 'migrations.migration', 'boardinghouse.schema', u'auth.user']

These models are required to be shared by the system.

boardinghouse.schema.activate_schema(schema_name)[source]

Activate the current schema: this will execute, in the database connection, something like:

SET search_path TO "foo",public;

It sends signals before and after that the schema will be, and was activated.

Must be passed a string: the internal name of the schema to activate.

boardinghouse.schema.activate_template_schema()[source]

Activate the template schema.

You probably don’t want to do this. Sometimes you do (like for instance to apply migrations).

boardinghouse.schema.deactivate_schema(schema=None)[source]

Deactivate the provided (or current) schema.

boardinghouse.schema.get_active_schema()[source]

Get the (internal) name of the currently active schema.

boardinghouse.schema.get_active_schema_name()[source]

Get the currently active schema.

This requires a database query to ask it what the current search_path is.

boardinghouse.schema.get_active_schemata()[source]

Get a (cached) list of all currently active schemata.

boardinghouse.schema.get_schema_model()[source]

Return the class that is currently set as the schema model.

boardinghouse.schema.is_shared_model(model)[source]

Is the model (or instance of a model) one that should be in the public/shared schema?

boardinghouse.schema.is_shared_table(table, apps=<django.apps.registry.Apps object>)[source]

Is the model from the provided database table name shared?

We may need to look and see if we can work out which models this table joins.