Specifying a mySQL ENUM in a Django model

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

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

9条回答
  •  暖寄归人
    2020-12-12 17:33

    If you really want to use your databases ENUM type:

    1. Use Django 1.x
    2. Recognize your application will only work on some databases.
    3. Puzzle through this documentation page:http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#howto-custom-model-fields

    Good luck!

提交回复
热议问题