class ScreenListTasks (Screen):
def __init __ (self, ** kwargs):
super () .__ init __ (** kwargs)
self.ids.List.data = ""
self.ids.List.data
Is List the Id of your widget?
Button:
Id:my_button_id
text: ‘my text here’
Would be accessed from python as: self.ids.my_button_id.text
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/1979ff11-a49d-433c-81bf-578c1a80e82c%40googlegroups.com.



To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5d3862f7.1c69fb81.a40bb.1e88SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
There are a few good questions here:
….RecycleView should have its contents erased every time the ListaRV class was called…
ListRV is a class it is constructed once at initialization. At initialization it is call in the constructor __init__().
This would be the same as doing it in KV.
ListRV:
data: my_data
Can you describe the user experience you want to achieve? I’m sure there is another way to get achieve your objective. As an aside, I’m pretty sure (without looking it up) that the data attribute needs to point to a list of dictionaries.
What is the meaning of this error?
__getattr__ is one of the methods in the Python data model. The details here: https://docs.python.org/3/reference/datamodel.html
It means that somewhere there is data access with an attribute error and __getattr__() has not been defined. You can also do a google search for __getattr__ or “Python Magic Methods” to learn more.
This might be caused because your are setting data to “”. You could try setting it to [{}] and see if you get a different result. More importantly, again I don’t think you will achieve the desired effect with __init__().
From the Pyhton docs:
The following methods can be defined to customize the meaning of attribute access (use of, assignment to, or deletion of x.name) for class instances.
object.__getattr__(self, name)
Called when the default attribute access fails with an AttributeError (either __getattribute__() raises an AttributeError because name is not an instance attribute or an attribute in the class tree for self; or __get__() of a name property raises AttributeError). This method should either return the (computed) attribute value or raise an AttributeError exception.
Note that if the attribute is found through the normal mechanism, __getattr__() is not called. (This is an intentional asymmetry between __getattr__() and __setattr__().) This is done both for efficiency reasons and because otherwise __getattr__() would have no way to access other attributes of the instance. Note that at least for instance variables, you can fake total control by not inserting any values in the instance attribute dictionary (but instead inserting them in another object). See the __getattribute__()method below for a way to actually get total control over attribute access.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGE5jT-WRx9ATxZVQHGoiuZFdz23znc-F5y7sAvSE6E%3DW37z%2BA%40mail.gmail.com.
class ScreenListTasks (Screen):
def on_pre_enter (self, * args):
self.ids.List.data = ""
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/5d38a016.1c69fb81.7fa79.7a3dSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CAGE5jT_mnfJcxfhmaL8R7SB-mdTfFcEV2UQ0pD6gNSWgpTv78g%40mail.gmail.com.