tinypig
V2EX  ›  Django

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

  •  
  •   tinypig · Jan 2, 2017 · 3977 views
    This topic created in 3614 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   ·   1281 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:20 · PVG 01:20 · LAX 09:20 · JFK 12:20
    ♥ Do have faith in what you're doing.