Introduce the DISPLAYED_FIELDS in formatter

This commit is contained in:
Florent 2014-06-17 15:45:13 +02:00
commit 30732318b5
4 changed files with 9 additions and 1 deletions

View file

@ -34,6 +34,7 @@ __all__ = ['Videoob']
class VideoListFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'title', 'duration', 'date')
DISPLAYED_FIELDS = self.MANDATORY_FIELDS + ('author', 'rating')
def get_title(self, obj):
return obj.title