'Connect to datbase, init graph.
If a database connection is supplied in db, use that, else connect
using the supplied or defaulted user, password, and database name.'

def __init__(self, db=None, user='sahana', password='password', dbname='sahana'):

    import MySQLdb
    OrderTables.__init__(self)
    if db:
        self.db = db
    else:
        self.db = MySQLdb.connection(host='localhost', user=user, passwd=password, db=dbname)
