Tuesday, 15 April 2014

python - Replace list comprehension with FK lookup -


I currently have an understanding of the following list:

  [item.service.name For OrderItem.objects.all ()], there is an FK  OrderItem  at   

service , hence the above code tones and tons

How to find any of the following questions? What do you want:

  OrderItem.objects.values_list ('service__name', flat = true) .distinct ()    

No comments:

Post a Comment