How To Serialize The Array Of Specific Field Of Class Object (getStream)
I'm trying to push EnrichedActivity data to FeedSerializer. I'm getting feed data using getStream class FeedAPIView(APIView): def get(self, request, format=None): feeds
Solution 1:
Here is my solution. Thanks to... @DwightGunning
feed = []
for activity in activities:
outfit_instance = activity.__dict__.get('activity_data').get('object')
data = FeedSerializer(
outfit_instance,
context={'request': request}).data
feed.append(data)
json_output = { "feed" : feed }
Post a Comment for "How To Serialize The Array Of Specific Field Of Class Object (getStream)"