django inline formsets with a complex model for the nested form

前端 未结 3 733
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 16:36

Say I have django model that looks something like this:

class Order(models.Model):
 number = models...
 date = models...

class OrderLine(models.Model):
 # O         


        
3条回答
  •  借酒劲吻你
    2020-12-18 17:07

    This sounds very similar to the approach talked about at help http://yergler.net/blog/2009/09/27/nested-formsets-with-django/ where Nathan writes about how he catered for "a multi-level data model; an example of this kind of model would be modeling City Blocks, where each Block has one or more Buildings, and each Building has one or more Tenants."

    Some more explanations can aslo be found here Django Forms Newbie Question

提交回复
热议问题