[Answer]-How to do inner join in django

1👍

current_discounts = CurrentDiscount.objects.all()

In view

for ds in current_discounts:
  print ds.discount.description

In html

{% for ds in current_discounts %}
  {{ds.discount.description}}
{% endfor %}

0👍

It’s a question of forignkey. You can set a forignkeyModel, and use

c = CurrentDiscount.objects.all()
c.availableDiscounts_set.all()

Leave a comment