We help IT Professionals succeed at work.

AttributeError:"InserData object has no attribute"weather2"

Dolamite Jenkins
on
AttributeError:"InserData object has no attribute"weather2"
 I'm getting error and I dont know why ... it's been some time since I worked with Python ... any ideas why Im gettine this error ...

self.nameofevet1=''
self.populateVenue(self)
self.weather2 = wx.Choice(self.panel, wx.ID_ANY, choices = self.nameofevet1, name='ShowList')


 def populateVenue(self,event):
	conn = lite.connect("xxxxxxx")
        c = conn.cursor()
        c.execute('select * from showlist')
	rows=c.fetchall()
            #print rows
	rRows=[]
	for row in rows:
                s={}
                s['Venue_name']  =row[1] 
		self.nameofevet1 = s['Venue_name']
		print self.nameofevet1
	self.weather2.Clear()
	self.weather2.AppendItems(self.nameofevet1)

Open in new window

Comment
Watch Question

It might help if you gave us a full stack trace and the entire code (or at least the entire class that populateVenue is a method of -- and hopefully that class is InserData) because your first three lines don't have any real context.

Assuming the error is happening on line 18 of your post (and that populateVenue is a class method), the error indicates that your InserData object doesn't have the weather2 attribute defined at the point your program is hitting line 17.

E.g.,

>>> class InserData():
...     pass
...
>>> a = InserData()
>>> a.weather2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: InserData instance has no attribute 'weather2'

Open in new window

Author

Commented:
thanks