missing field after makemigrations

54 views
Skip to first unread message

andrew snyder

unread,
Jun 20, 2022, 10:12:58 AM6/20/22
to Django users
There is something in my models.py that breaks makemigrations.

The field "rank" is missing from "CharacterSkill".  Also, if I uncomment any of the three classes that refer to "Character" the "game" and "player" fields become separate items in the migrations file.
models.py
0001_initial.py

Moheb Mithani

unread,
Jun 20, 2022, 10:53:37 AM6/20/22
to Django users
Hi,
The reason why "rank" is missing is because you didn't use round brackets "(" ")". It should be "models.SmallIntegerField()" not "models.SmallIntegerField".

andrew snyder

unread,
Jun 20, 2022, 11:37:40 AM6/20/22
to Django users
Thanks, that did the trick.  Should I make a feature request that django throw an error whenever a field type has no real type?

>>> type(models.SmallIntegerField())
<class 'django.db.models.fields.SmallIntegerField'>
>>> type(models.SmallIntegerField)
<class 'type'>
Reply all
Reply to author
Forward
0 new messages