Я хочу напечатать значение, выбранное из моего списка, в метку, но когда я щелкнул в этом списке, у меня появляется сообщение об ошибке:
selected = self.ids.op_selected File "kivy\properties.pyx", line 863, in kivy.properties.ObservableDict.__getattr__
AttributeError: 'super' object has no attribute '__getattr__'
this my py
class RVItem(Factory.Button):
def get_data_index(self):
return self.parent.get_view_index_at(self.center)
def on_press(self):
print(self.get_data_index())
selected = self.ids.op_selected
selected.text = self.text
class SecondWindow(BoxLayout, Screen):
myresult = ListProperty([("liste_des_operations_id","PART_NO","Operation__NO","OPERATION_DESCRIPTION")])
def insert_part(self):
partnum = self.ids.Part_field
part = partnum.text
mycursor.execute(
"SELECT * FROM liste_des_operations WHERE PART_NO = %s",
(part,))
self.myresult = mycursor.fetchall()
кв
BoxLayout:
orientation:'vertical'
RecycleView:
id: list_des_operation
data: [{'text':"{}".format(OPERATION_DESCRIPTION)} for liste_des_operations_id,PART_NO,Operation__NO,OPERATION_DESCRIPTION in root.myresult]
viewclass: "RVItem"
text_selected: ""
RecycleBoxLayout:
default_size: None, dp(56)
orientation: "vertical"
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
key_selection: 'selectable'
multiselect: True
touch_multiselect: True
Label:
id: op_selected
text: "op"