click
V2EX  ›  Django

如何把author的值默认为当前用户?

  •  
  •   click · Aug 24, 2013 · 3531 views
    This topic created in 4761 days ago, the information mentioned may be changed or developed.
    models里有author=models.CharField(max_length=30)
    我想把这个字段值默认为当前用户
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5909 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 03:22 · PVG 11:22 · LAX 20:22 · JFK 23:22
    ♥ Do have faith in what you're doing.