tinypig
V2EX  ›  Django

如何较好的在同一个 View 中处理多个关联 Form?

  •  
  •   tinypig · Jan 2, 2017 · 3943 views
    This topic created in 3595 days ago, the information mentioned may be changed or developed.

    如下有两个 Model :

    class User(Model):
        name = xxxx
    
    class UserProfile(Model):
        user = OneToOneField(User)
        phone = xxxx
    

    需要在一个页面中批量加入用户信息,那么如何处理 Form(FormSet)比较好呢?

    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2395 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:14 · PVG 19:14 · LAX 03:14 · JFK 06:14
    ♥ Do have faith in what you're doing.