[Answer]-Select * where we have the reference value exists multiple times

1👍

Use filter() instead of get(). get fetches only one result.

def rewardhistory(request):
    reward = Rewardpoints_log.objects.filter(userid='894490') 
    return render_to_response('credits.html', 'reward':reward},context_instance=RequestContext(request))

I’m guessing you’re not using any relationship between your models. I suggest you start doing that.

0👍

BY USING FILTER IT GIVES

Rewardpoints_log: 202 >,

IN THE HTML FILE BY USING THIS

{{ reward }}

WHEN I TRY

{{ reward.rewardpoints }}

IT RETURNS NOTHING

Leave a comment