def get_addresses_model(parent: QObject = None) -> QSqlQueryModel: model = QSqlQueryModel(parent) model.setQuery("SELECT distinct address FROM public.customers;") if model.lastError().isValid(): raise RuntimeError(model.lastError().text()) return model
def get_discount_groups_model(parent: QObject = None) -> QSqlQueryModel: model = QSqlQueryModel(parent) model.setQuery("SELECT distinct discount_group FROM public.merchandise;") if model.lastError().isValid(): raise RuntimeError(model.lastError().text()) return model