I have a list of Products
, each belonging to a different Distributor
.
I need to display a form for each of those products and their corresp
You can try to do it like here:
https://stackoverflow.com/a/2176471/4971083
It's the solution for ordering your records by specific value in Django. You could order your records by distributor_name = 'FirstDistributor'
p= Product.objects.filter(product__id=product_id).extra(
select={'is_top': " distributor__name='FirstDistributor'"})
p = p.extra(order_by = ['-is_top'])