use if hasattr(self, 'lt_realization') instead of if self.lt_realization