Django Formset without instance

前端 未结 2 1771
眼角桃花
眼角桃花 2021-02-04 14:14

In this Django Doc explain how to create a formset that allows you to edit books belonging to a particular author.

What I want to do is: Create a formset that allows you

2条回答
  •  被撕碎了的回忆
    2021-02-04 14:26

    This depends on whether you're doing it yourself, or using the built-in admin.

    If you're using the admin, you can use inlines.

    If you're doing this in your own application, then it's up to you. Create a single form which has fields for a new author and book. When the user submits the form, it's your job to create the new records.

提交回复
热议问题