def get_month(self, date): ''' Returns the corresponding month if it has previously been visited, otherwise a new month is created and returned ''' year_and_month = dates.get_year_and_month_from_date(date) # Selected month has not been loaded or created yet if year_and_month not in self.months: self.months[year_and_month] = Month(date.year, date.month) return self.months[year_and_month]
def get_month(self, date): ''' Returns the corresponding month if it has previously been visited, otherwise a new month is created and returned ''' year_and_month = dates.get_year_and_month_from_date(date) # Selected month has not been loaded or created yet if year_and_month not in self.months: self.months[year_and_month] = Month(date.year, date.month) return self.months[year_and_month]