Django Templates First element of a List
You can try this: {{ v.docs.0 }} Like arr.0 You can get elements by index (0, 1, 2, etc.).
You can try this: {{ v.docs.0 }} Like arr.0 You can get elements by index (0, 1, 2, etc.).
Based on your error message and this other question, it seems to me this would fix it: p = Product.objects.filter(vendornumber=”403516006″)\ .order_by(‘vendor__name’, ‘-created’).distinct(‘vendor__name’) That is, it seems that the DISTINCT ON expression(s) must match the leftmost ORDER BY expression(s). So by making the column you use in distinct as the first column in the order_by, I … Read more