def industry_query(self, name): conn = self.connect() cur = conn.cursor() cur.execute("select * from industry where name='%s'"%(name)) results = cur.fetchone() ind = industry() ind.id = results[0] ind.name = results[1] ind.code = results[2] ind.pid = results[3] cur.close() return ind