zzofbg
Last Updated: February 25, 2016
·
588
· purak
Fe0a1519fcf6d2efd7f1a0bbc20660d2

Selecting particular fields in Django ORM

If you want to select particular fields from a table, you can use the following trick instead of using TableName.objects.get() or something like that.

Documents.objects.values_list('title', 'slug')

That returns a result like the following:

[(u'Installing Hadron', u'installing-hadron')]
Say Thanks
Respond