def to_json_search_result(self): data = self.to_json data['detail_href'] = get_absolute_url('images_api.images_detail', image_id=self.id) data['genre'] = self.artist.genre return data
def to_json_with_detail(self): data = self.to_json data['detail_href'] = get_absolute_url('images_api.images_detail', image_id=self.id) return data
def to_json_with_artist(self): data = self.to_json data['artist_href'] = get_absolute_url('artists_api.artists_detail', artist_id=self.artist.id) return data
def to_json_with_artworks(self): data = self.to_json data['artworks_href'] = get_absolute_url('artists_api.artists_artworks', artist_id=self.id) return data