Closed ocrasborn closed 5 years ago
I was thinking this would be something I could do quickly. I was wrong. During makemigrations
it complains that it's missing the reference column, while creating it is of course the only reason I'm running makemigrations
. The problem seems to be that apparently the Dataset object is imported in urls.py
before the migrations are done, and thus is expected to have a correct database.
To be more precise: the problem is during makemigrations
it tries to initiate all classes in the Signbank code. One of these classes is RegistrationForm
, which is a form used for requesting accounts. This form has the option to request access to particular datasets, and to be able to populate this option the Dataset
model has to be correct.
My solution was to allow this process of populating the dataset option of the RegistrationForm
to fail. The assumption is that it will only fail during migrations of the Dataset
model, not when Signbank is actually running.
It now wants to create the migration file!
Okay it's now available in the interface! Happy @ocrasborn ?
:-)
See e.g. the NGT one: https://signbank.science.ru.nl/datasets/detail/5 In the last field, I've now added the information for the reference that people should use, but it'd be clearer to both dataset managers and users if that were a separate field, at the bottom of the list.