django choices () rather than {}

622 단어 django
`(` instead of `{`  
    YEAR_IN_SCHOOL_CHOICES = (
        ('FR', 'Freshman'),
        ('SO', 'Sophomore'),
        ('JR', 'Junior'),
        ('SR', 'Senior'),
        ('GR', 'Graduate'),
    )

The problem was every time I run makemigrations it will generate a new migration file even if there are no changes in the model. The reason is that set is unordered, so every time you run makemigrations the order is different and that is detected as a change in the model.

좋은 웹페이지 즐겨찾기