Signbank / Global-signbank

An online sign dictionary and sign database management system for research purposes. Developed originally by Steve Cassidy/ This repo is a fork for the Dutch version, previously called 'NGT-Signbank'.
http://signbank.cls.ru.nl
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

Add a field 'Reference' to the metadata page for a dataset #540

Closed ocrasborn closed 5 years ago

ocrasborn commented 5 years ago

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.

Woseseltops commented 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.

Woseseltops commented 5 years ago

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!

Woseseltops commented 5 years ago

Okay it's now available in the interface! Happy @ocrasborn ?

ocrasborn commented 5 years ago

:-)