AdminConnection

Author:Neil Wallace (neil@openmolar.com)
Release:2.0.906~hg207
Date:April 18, 2013

Inherits from OpenmolarDatabase adding some functionality required only by the openmolar admin application.

A very important function is populateDemo() which populates the current database with demo data. This dangerous action is only performed if the database name ends with _demo or _test to prevent random data going into a real database.

Note

If this class is initiated with no arguments, a connection to the openmolar_demo on localhost will be established if possible.

methods and attributes

class lib_openmolar.admin.connect.AdminConnection(connection_data)[source]

Bases: lib_openmolar.common.qt4.postgres.openmolar_database.OpenmolarDatabase

inherits from lib_openmolar.common.connect.OpenmolarDatabase, which in turn inherits from PyQt4.QSql.QSqlDatabase

__init__(connection_data)
admin_modules[source]

provide access to the list of modules in use

connect(*args)
emit_(*args)[source]

emit signals but be wary of case when there is no gui (ie. when install demo is called from CLI)

get_available_tables()[source]

returns a list of tables in the currently selected database

populateDemo(ommitted_modules=[])[source]

checks connection is to openmolar_demo, and if so, adds demo data to the tables.

Table Of Contents

Previous topic

Admin Classes

Next topic

AdminMain