def format_date(self): if self.datetime: day = self.datetime.day day = ordinal(day) rest = self.datetime.strftime('%B %Y') return ' '.join((day, rest)) else: return '?'
def recent_results(self): results = [] for comp, photos in recently_completed_competitions(): new_photos = [] classes = ('badge-first', 'badge-second', 'badge-third') for photo in photos: new_photos.append(( ordinal(photo.position), classes[photo.position - 1], photo.total_score, photo.user.id(), photo.user.get().username, )) results.append((comp, new_photos)) return results
def ordinal_position(self): return ordinal(self.position)