-
Notifications
You must be signed in to change notification settings - Fork 98
Add configuration file for default values to populate e.g. status choices for different core applications #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
'No', | ||
'Attribute Expanded Text' | ||
), | ||
'statuschoices': ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was considering adding comments to this file that indicate which default options are required for Coldfront to function - e.g., the "Active" status choice is so ubiquitous in the codebase that removing it as a default would require a lot of changes.
'Float', | ||
'Int', | ||
'Text', | ||
'Yes/No', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a side note, but I've been curious about why yes/no is used here instead of booleans and where the "no" option is more appropriate than "yes/no".
'projectuserstatuschoices': ( | ||
'Active', 'Pending - Add', 'Pending - Remove', 'Denied', 'Removed' | ||
), | ||
# in utils.add_project_user_status_choices, projectuserstatuschoices are ['Active', 'Pending Remove', 'Denied', 'Removed']. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left this question in the code. I didn't find "Pending Remove" in the code anywhere so I think I chose the correct options.
I originally floated the idea of adding a new config file that would serve as a central reference list for all objects that are to be automatically added to the database in functions like add_allocation_defaults here. This PR is a follow-up on that. I included the default values for all apps with add_default commands in the config file, and then replaced the lists/tuples of those default values in the add_defaults commands with references to the config file.
There are a few ways I could see this config file being useful for other purposes, e.g., checking whether a given item is in the database in a given view.