Django models with OneToOne relationships?

前端 未结 3 1012
南旧
南旧 2021-02-09 12:21

Let\'s say I\'m using the default auth.models.User plus my custom Profile and Address models which look like this:

class P         


        
3条回答
  •  心在旅途
    2021-02-09 13:04

    I think your are looking for inline formsets with model forms. This helps you to deal with multiple forms on one page and also takes care of foreign key relations.

    Update:

    Maybe this question helps you too: Django: multiple models in one template using forms

提交回复
热议问题