def getall(event, context): accounts = Account.select() account_list = [] for account in accounts: tmp = dict() tmp['id'] = account.id tmp['name'] = account.name tmp['address1'] = account.address1 tmp['address2'] = account.address2 tmp['state'] = account.state tmp['city'] = account.city tmp['zip'] = account.zip tmp['phone'] = account.phone tmp['web'] = account.web tmp['contact_name'] = account.contact_name tmp['contact_email'] = account.contact_email account_list.append(tmp) response = {"statusCode": 200, "body": json.dumps(account_list)} return response # Use this code if you don't use the http event with the LAMBDA-PROXY # integration """
import os.path from sys import argv, exit from qtpy.QtWidgets import QApplication from controller import RegisterController from controller.main_controller import MainController from model import init_database, Account from utils import get_app_folder from view import RegisterDialog from view.main_window import MainWindow if __name__ == '__main__': app = QApplication(argv) init_database(os.path.join(get_app_folder(), "database.sqlite")) accounts = Account.select() if not accounts: register_controller = RegisterController() register_dialog = RegisterDialog(register_controller) register_dialog.exec() controller = MainController() window = MainWindow(controller) exit(app.exec_())