How can I select multiple columns from a Django model? -


at moment have query selects distinct values model:

meeting.objects.values('club').distinct() 

in addition 'club' field, wish select 'time' field. in other words wish select distinct values of 'club' field , associated 'time' field. example for:

club,time  abc1,10:35 abc2,10:45 abc2,10:51 abc3,11:42 

i want:

abc1,10:35 abc2,10:45 abc3,11:42 

what syntax this?

this possible, if database backend postgresql. here how can done:

meeting.objects.order_by('club', 'time').values('club', 'time').distinct('club') 

look documentation distinct


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -