Django: Forcing admin users to enter at least one item in TabularInline

后端 未结 3 1098
死守一世寂寞
死守一世寂寞 2021-02-04 13:36

In my admin for an object Chair I have a TabularInline for an arbitrary number of Desk objects. I want every Chair to always

3条回答
  •  攒了一身酷
    2021-02-04 14:09

    Matthew Flanagan has a great example of how to require one valid form in a formset: http://code.google.com/p/wadofstuff/wiki/WadOfStuffDjangoForms and http://wadofstuff.blogspot.com/2009/08/requiring-at-least-one-inline-formset.html Hope that helps you out.

提交回复
热议问题