Skip to content
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

Adjust source fields: holding_institution, name, production_method, source_completeness #1645

Merged
merged 8 commits into from
Oct 11, 2024

Conversation

dchiller
Copy link
Contributor

@dchiller dchiller commented Oct 2, 2024

NOTE: This PR removes some previously-committed migrations. You will need to re-create your local/staging database to do development after this PR is merged. I decided to do this because it will make the update of production go smoother (ie. not have to run to a certain migration, then run the migrate_records command, then apply the rest of the migrations), which ultimately felt preferable to prioritizing people's individual current development database status.

Makes significant changes to the Source model:

  • removes the requirement for a Source to have a holding_institution. Remove requirement for sources to have a holding institution if source is a reconstruction #1631 requests that holding_institution-less sources be possible only for reconstruction sources. This will be added once source_completeness field is available to mark reconstructions as such (see To-do's below).
  • adds default [No Shelfmark] to Source.shelfmark field.
  • adds the source_completeness choice field to replace the full_source boolean field and add the "Reconstruction" option. A command, populate_source_completeness, will populate the initial values of this field. Note that after this new field is populated, the full_source field will be redundant and can be removed (see To-do's below).
  • adds the production_method choice field to note (currently) whether a source is a manuscript or printed source.

These changes are reflected in source create, edit, detail, and list pages. Relevant tests are also updated.

Makes cosmetic changes to the Institution model by changing various field defaults from latin abbreviations to english words.

Adds the source's name field to source create, edit, and detail views and to the source heading.

Performs some minor cosmetic changes: refactors forms.py a bit with a new StyledChoiceField class so that repeated changes to widget style attributes are no longer necessary and changes the ordering of the options in the "Holding Institution" input field on the Source admin page.

To-Do's

Closes #1628.

Most display changes occur on the source list and source detail pages. In screenshots below, disregard repetitions of "(fragment)" on new version...these will be fixed in underlying data.

Page Old version New version
Source list (colloquial name/fragment) image image
Source list private collection as shown in previous row image
Source detail (colloquial name) image image
Source detail (fragment/private collection) image image

@dchiller dchiller changed the title Adjust source fields: holding_institution, shelfmark, production_method, source_completeness Adjust source fields: holding_institution, shelfmark, name, production_method, source_completeness Oct 2, 2024
@dchiller dchiller changed the title Adjust source fields: holding_institution, shelfmark, name, production_method, source_completeness Adjust source fields: holding_institution, name, production_method, source_completeness Oct 2, 2024
@dchiller
Copy link
Contributor Author

dchiller commented Oct 2, 2024

The failing test will be fixed with the merge of #1643 -- once that is reviewed and merged I'll fix this.

Updates source create, source edit, and source detail pages.

Adds command to populate the `source_completeness` field based on the current contents of the `full_source` field (which can be deleted after this field is populated).
Removes the need to duplicate process of using default SelectWidget on ChoiceFields and then manually changing attributes.
This commit removes the requirement for a source to have a holding_institution.

Tests and forms are updated to account for this.

The `migrate_records` command is updated so that sources with un-parseable sigla that are not otherwise accounted for (by virtue of being private collections or prints) do not have institution records made.

Note: For the purposes of data migration, no constraint is added to sources to designate when no holding institution is necessary. After migration, these should be modified.

Refs: DDMAL#1631
@dchiller
Copy link
Contributor Author

dchiller commented Oct 4, 2024

Tests are now passing. Have not heard back confirmation on some of the remaining formatting questions, so holding for the moment.

@dchiller
Copy link
Contributor Author

dchiller commented Oct 7, 2024

Ok, after discussing the remaining questions with Anna, Debra, and Jennifer:

  • (fragment) goes after source title and source Cantus siglum where relevant
  • ("Colloquial name") goes after title on source detail page
  • "Colloquial name" goes at the start of the summary column on the browse sources page

@dchiller dchiller removed the on hold label Oct 7, 2024
@dchiller
Copy link
Contributor Author

dchiller commented Oct 7, 2024

@lucasmarchd01 this is ready for you now

Copy link
Contributor

@lucasmarchd01 lucasmarchd01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@dchiller dchiller merged commit 1dfe503 into DDMAL:develop Oct 11, 2024
1 check passed
@dchiller dchiller deleted the i1628-source-printed branch October 15, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a field to identify if a Source is a printed book or a manuscript
3 participants