Specifying a mySQL ENUM in a Django model

前端 未结 9 1792
说谎
说谎 2020-12-12 17:16

How do I go about specifying and using an ENUM in a Django model?

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 17:40

    A the top of your models.py file, add this line after you do your imports:

        enum = lambda *l: [(s,_(s)) for s in l]
    

提交回复
热议问题