[Answer]-I can't figure out the django qeryset for retriving a value from a field by a condition

1👍

You can use .values() to fetch only certain values (example from the docs):

>>> Blog.objects.values('id', 'name')
[{'id': 1, 'name': 'Beatles Blog'}]

In your case:

MyModel.objects.filter(mobile_name='xyz').values('total_mark')
👤sk1p

Leave a comment