Added start blocke on no database connection available
This commit is contained in:
@@ -4,9 +4,12 @@ import json
|
||||
|
||||
|
||||
class AddressDAO:
|
||||
__cur = None
|
||||
def __init__(self):
|
||||
#print(f"*** File: {__file__}, init()")
|
||||
self.__con = DbManager().getConnection()
|
||||
self.__cur = self.__con.cursor()
|
||||
if self.__con:
|
||||
self.__cur = self.__con.cursor()
|
||||
|
||||
|
||||
def __importPlz(self):
|
||||
@@ -29,6 +32,9 @@ class AddressDAO:
|
||||
print("FINISHED")#
|
||||
|
||||
def getAddressData(self, all = True, zipcode = None):
|
||||
self.__cur.callproc("getAddress", (all, zipcode,))
|
||||
self.__data = self.__cur.fetchall()
|
||||
return self.__data
|
||||
if self.__cur:
|
||||
self.__cur.callproc("getAddress", (all, zipcode,))
|
||||
self.__data = self.__cur.fetchall()
|
||||
return self.__data
|
||||
else:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user