def update_archived_flag(self): "Updates the 'Archived' flag, depending if the the end date is set or not" utc = utils.localize_to_utc(datetime.utcnow()) if self.get_date_time_end_utc(): self.archived = self.get_date_time_end_utc() < utc else: self.archived = self.get_date_time_begin_utc() + timedelta(hours=1) < utc
def get_date_time_end_utc(self): "Gets the 'End' date/time in UTC." return utils.localize_to_utc(self.date_time_end);
def get_date_time_modified_utc(self): "Gets the 'Modifed' date/time in UTC." return utils.localize_to_utc(self.date_time_modified);
def get_date_time_begin_utc(self): "Gets the 'Begin' date/time in UTC." return utils.localize_to_utc(self.date_time_begin);
def get_date_time_created_utc(self): "Gets the 'Created' date/time in UTC." return utils.localize_to_utc(self.date_time_created);