Django group by foreign key id -


how can group query qualifications , group them quote__uuid? looked aggregation doesn't seem fit need.

my ideal output [{'quote_uuid_1':[qualification_1, qualification_2], 'quote_uuid_2':[qualification_3] }]

class quote    uuid = models.charfield()  class qualification    quote = models.foreignkey(quote) 

try:

result = [{quote.id:quote.qualification_set.all()} quote in quote.objects.all()] 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -