import sys from PyQt4 QtCore import from PyQt4 QtGui import from sqlal

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from sqlalchemy.orm import sessionmaker
from models import *
from vivaio_ui import *
from sqlalchemy.orm import sessionmaker
class Manager:
def __init__(self):
self.engine = create_engine('sqlite:///../vivaio_db')
self.Session = sessionmaker(bind=engine)
self.session = self.Session()
def create_new_client(name, surname, cell, address):
new_client = Client(name, surname, cell, address)
print new_client
self.session.add(new_client)
self.session.commit()
class StartGui(QMainWindow):
def __init__(self):
QWidget.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
if __name__ == "__main__":
app = QApplication(sys.argv)
gui = StartGui()
gui.show()
sys.exit(app.exec_())