Reputation: 34200
How to print the test field in the following query in django
res=Resources.objects.filter(test=request.profile)
logging.debug(test) # won't work
I wanted to check what this value is compared with..
Upvotes: 0
Views: 504
Reputation: 626
You may also try the values_list
method, eg:
Resource.objects.filter(test=request.profile).values_list("test")
It returns a list of tuples with the value of "test" for each matched record.
Upvotes: 0
Reputation: 799580
You have to iterate through res
and print each model's value of test
in turn.
Upvotes: 1