My problem in the simplified version is the following:
class FirstWindow(Screen):
koszyk = ""
#class Koszyk has 2 attributes: Lista_produktów, Wagi_produktów
def generate_basket(self):
[...]
koszyk = Koszyk(list_of_products,weights)
self.koszyk = koszyk
def show_result(self):
print(self.koszyk.Lista_produktów)
print(self.koszyk.Wagi_produktów)
class SecondWindow(Screen):
def generate(self):
print(FirstWindow.koszyk.Wagi_produktów)
Whenever I am printing self.koszyk in FirstWindow, it works and it shows the values, whenever I try to do the same in SecondWindow using generate() function, it doesn't work. Error that I am having is:
AttributeError: 'str' object has no attribute 'Wagi_produktów'
How to fix my problem?