I am trying to display a different price for each item in a list, based on the logged-in user information.
However, my current code seems to overwrite the "price" key with the first occurrence "custom_price" ... I cannot seem to find a solution.
class MenuListView(ListView):
    model = Menu
    template_name = 'home.html'
    def get_context_data(self, **kwargs):
        if self.request.user.is_authenticated:
            context = super(MenuListView, self).get_context_data(**kwargs)
            user=get_object_or_404(Profile, user = self.request.user)
            coef = user.bmr
            menus = Menu.objects.all()
            price = []
            for menu in menus:
                menu_price = menu.price
                menu_kcal = menu.kcal
                custom_price = (menu_price/menu_kcal) * (coef*(35/100))
                price.append(custom_price)
            context['menus'] = menus
            context['prices'] = price
            return context
Template:
  {% for item in menus %}
            <div class="col-sm-6 col-md-6 col-lg-6">
                <div class="food-card food-card--vertical">
                    <div class="food-card_img">
                      {% for img in item.photo_set.all %}
                        <img src="{{ img.image.url }}" alt="">
                        {% endfor %}
                    </div>
                    <div class="food-card_content">
                        <div class="food-card_title-section">
                            <span  class="food-card_title">{{ item.title }}</span>
                            <span  class="food-card_author">{{ item.category }} - {{ item.focus }}</span>
                        </div>
                        <div class="food-card_bottom-section">
                            <div class="space-between">
                                <div>
                                    <span class="fa fa-fire"></span> {{ item.kcal }} Kcal
                                </div>
                            </div>
                            <hr>
                            <div class="space-between">
                                <div class="food-card_price">
                                          {% for p in prices %}
                                    <span>{{ p }} €</span>
                                          {% endfor %}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            {% endfor %} 
Could someone help ?
Many thanks in advance !