def get_value(self): if CustomEditor.get_value(self) is ValueLoading: return ValueLoading self.years_spinbox.interpretText() years = int(self.years_spinbox.value()) self.months_spinbox.interpretText() months = int(self.months_spinbox.value()) value = (years * 12) + months return value
def get_value(self): if CustomEditor.get_value(self) is ValueLoading: return ValueLoading self.years_spinbox.interpretText() years = int(self.years_spinbox.value()) self.months_spinbox.interpretText() months = int(self.months_spinbox.value()) years_is_none = (years == self.years_spinbox.minimum()) months_is_none = (months == self.months_spinbox.minimum()) if years_is_none and months_is_none: return None if years_is_none: years = 0 if months_is_none: months = 0 return (years * 12) + months