Q: Serializing a dictionary that is not a model in Django restframework I have read a few answers and posts about serializing an dictionary . But I still can't get it to work.
Here is the problem. 
I do some data processing in django app , and it returns this dictionary (It has information about a quiz):
{101: {'subject': 'General-Intelligence', 'topics': ['Coding Decoding', 'Dice & Boxes', 'Statement & Conclusion', 'Venn Diagram', 'Mirror and Water Image', 'Paper Cutting and Folding', 'Clock/Time', 'Matrix', 'Direction', 'Blood Relation', 'Series Test', 'Ranking', 'Mathematical Operations', 'Alphabet Test', 'Odd one out', 'Analogy'], 'num_questions': 25, 'creator': 'Rajesh K Swami'}}

I want to serialize this dictionary. 
So what I have done is created a class for this dictionary. ie.
class PsudoTests:

    def __init__(self,body):
        self.body = body

Also a serializer:
class PsudoTestSerializer(serializers.Serializer):
    body = serializers.DictField()

Now in api view :
class TestListView(generics.ListAPIView):

    def get_serializer_class(self):
        serializer = PsudoTestSerializer

    def get_queryset(self):
        me = Studs(self.request.user)
        tests = me.toTake_Tests(1) # this method brings in the above dictionary that i want to serialize
        p_test = PsudoTests(tests) #this creates an instance of class created above

        return p_test

Now when i go to the url there is a key error:

"Got KeyError when attempting to get a value for field body on serializer PsudoTestSerializer.\nThe serializer field might be named incorrectly and not match any attribute or key on the dict instance.\nOriginal exception text was: 'body'."

How can I successfully get that dictionary in json format when I go to the api url.
Thanks.

A: There is no need for a serializer here. Just dump it straight to JSON.
