Django: how to display form errors for each model object in a inline formset

后端 未结 2 1057
名媛妹妹
名媛妹妹 2021-01-02 12:17

I have a author model and a books model. A user can modify properties of all the books from a given author. I want to be able to display errors for each individual book rath

2条回答
  •  不知归路
    2021-01-02 12:47

    Assuming the book is a form you could do:

    {% for b in authorsbooks %}
        {{b.errors}}
    {% endfor %}
    

提交回复
热议问题