Chemical-Curation / chemcurator_django

Backend services for chemical curation
https://api.chemreg.epa.gov
MIT License
1 stars 0 forks source link

174 list model #192

Closed scaduto closed 4 years ago

scaduto commented 4 years ago

Closes #174

There is an issue that arose with this ticket. In the ticket description, the owners attribute is defined as (A list of users, default current user). The problem here is that Django has issues with providing a default in a many to many relationship.

More info regarding that can be found below:

https://code.djangoproject.com/ticket/2750

The way that we would go about obtaining the current user pk here would be by setting the default to

default=get_current_user_pk

However based on the issue above, there is no valid way to test if this is working as Django does not allow you to properly authenticate from the command line and when creating a list object, I am continuously receiving an empty set of data.

scaduto commented 4 years ago

Another thing that I wanted to clarify with this model is that the descriptions for label and short_description state that they both have different character limits than their ControlledVocabulary counterparts. I went ahead and overwrote them and created new ones in the List model but I was not sure if this was intended. @cmgrulke

cmgrulke commented 4 years ago

So I don't really consider a list a controlled vocabulary (though if that is how you decided to implement it, I can understand why since it has many of the same fields). List objects are likely going to become pretty complex and have many complex business processes associated with them whereas controlled vocabularies are generally just boring objects that are simple annotations for other important business relevant classes.

The delete/deprecation behavior of lists should definitely not be the same as that for a controlled vocabulary, but will be specified in later tickets.