Django. Get values for all fields in one object

I’m trying to make a JSON that will look like this:

[
    {
        "num_of_followers": 2,
        "name": "Math 140",
        "created_by": "aaa"
    }
]

The problem is I don’t really understand how I can get a list of values for one particular database object (another words how can I get the whole row )

@csrf_exempt
def create_subject(request, subject):
    subject, created= Subjects.objects.get_or_create( 
        name=subject,
        user=request.user,
        created_by=request.user)
    list = []
    columns = [Subjects._meta.get_all_field_names()]
    row = ????????
    for value in row:
        record = dict(zip(columns,value))
        list.append(record)
    result = simplejson.dumps(list, indent=4)
    return HttpResponse(result)

Best answer

use .values() queryset method:

@csrf_exempt
def create_subject(request, subject):
    subject, created= Subjects.objects.get_or_create( 
        name=subject,
        user=request.user,
        created_by=request.user)

    return HttpResponse(
        simplejson.dumps(
            list(models.Subject.objects.filter(id=subject.id).values()), 
            indent=4
        )
    )