def query(cls): with DatabaseFactory.create_connection() as db: return db.fetchall('select code from %s' % cls.__table__)