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
- [Answer]-Trigger method on user creaton
- [Answer]-Django Ajax Values Returned but Not Being Displayed in Drop-down List
Source:stackexchange.com