Ejemplo n.º 1
0
def clear_database():
    """ drops all data in the database but leaves the table structure

        """
    connection, cursor = PHdbOps.connectDB()

    cursor.execute("DELETE FROM company")
    cursor.execute("DELETE FROM contact")
    cursor.execute("DELETE FROM project")
    cursor.execute("DELETE FROM session")
    connection.commit()
Ejemplo n.º 2
0
# Copyright Notice: Copyright 2012, 2013 Christopher Olsen
# License: None. All rights reserved.
#
# Once this project reaches maturity it will likely be released into the
# wild but for now I'm removing the license to relieve myself from the fears
# of being prematurely forked.


## *** THIS FILE HOLDS THE DISPLAY AND LOGIC CODE, FOR MYSQL INTERFACE SEE
## PHdbOperations.py ***


import wx
import PHdbOperations as PHdb

connection, cursor = PHdb.connectDB()


class Observable(object):
    """ An observer class to facilitate tab synchronization.  ie when a comapny
        is active in the Company tab only projects and contacts from that
        company will show in the other tabs (showall button is still there)

        """

    def __init__(self):
        self.observers = []

    def add_observer(self, observer):
        self.observers.append(observer)