hey there<br><br>i have written a module called site.py<br>in the file i have this:<br><br>import DbConnector<br>import sensor<br><br>class Site(object):<br>&nbsp;&nbsp;&nbsp; &quot;site object&quot;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def __init__(self, id):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://self.id">self.id</a> = id<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.con = DbConnector.DbConnector()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id = str(<a href="http://self.id">self.id</a>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stats = self.con.getOne(&quot;selct `group_id`, `name`, `ivr_code`, \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; `site_type`, `notes`, `sensor_id` \<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from `sites` where `id` = '&quot;+str(id)+&quot;' &quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.group_id = stats[0]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://self.name">self.name</a> = stats[1]
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.ivr_code = stats[2]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.site_type = stats[3]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.notes = stats[4]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.sensor_id = stats[5]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; def get_sensor(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.sensor = sensor.Sensor
(self.sensor_id)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.sensor<br><br>ok, in the program i am trying to run i have these lines:<br>import site<br>new_site = site.Site(id_number)<br><br>and this is what my output is:<br>Traceback (most recent call last):
<br>&nbsp; File &quot;./new_camp.py&quot;, line 2014, in on_site_tree_view_row_activated<br>&nbsp;&nbsp;&nbsp; acitve_site = site.Site(id_number)<br>AttributeError: 'module' object has no attribute 'Site'<br><br>It looks like the same code works for a different module i have ;
<br>i don't get what i could be missing here, any tips?<br><br>if you have read this far, thanks for your time.<br>sk<br><br><br><br>