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

Add Tectonic Unit paleoContexts relationship to the datamodel #6059

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

melton-jason
Copy link
Contributor

Fixes #6042

This PR does not address the true underlying cause: that it's easy to miss such a relationship in the datamodel to begin with!
A more ideal solution to make sure this problem doesn't happen again is to write a backend test to verify the integrity of the datamodel.
Alternatively, we can remove the separate datamodel file entirely, and only use the Django models and fields, adding any necessary attributes to the fields as need (and implementing a way to enforce integrity for those attributes).

While investigating the Issue, I also uncovered another bug which may be relavent for testing: #6058

Checklist

  • Self-review the PR after opening it to make sure the changes look good and
    self-explanatory (or properly documented)
  • Add automated tests
  • Add relevant issue to release milestone
  • Add relevant documentation (Tester - Dev)

Testing instructions

  • In a database which has a paleo/geo discipline (such as ciscocollections from Adding Paleo Context to COG's child CO causes FieldDoesNotExistError #6042 (comment)), switch to a Collection in a Geo/Paleo discipline
  • If not present already, add TectonicUnit to the PaleoContext form (either as Subview or Query Combo Box)
  • Navigate to the Data Entry form for a table which has a relationship to PaleoContext (paleo_context_schema and TectonicUnit)
  • Add a new or edit an existing PaleoContext which has a related TectonicUnit
    • No error should occur
  • On the Tectonic Unit form, display the paleoContexts relationship as a Subview and ensure that PaleoContexts can be added, removed, and edited

@melton-jason melton-jason added this to the 7.9.11 milestone Jan 10, 2025
@melton-jason melton-jason requested review from a team January 10, 2025 03:04
@melton-jason melton-jason changed the title Add missing datamodel relationship Add Tectonic Unit paleoContexts relationship to the datamodel Jan 10, 2025
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

Cannot render tectonic unit as a subview in paleo context

image

@acwhite211 acwhite211 self-requested a review January 10, 2025 15:44
Copy link
Collaborator

@emenslin emenslin left a comment

Choose a reason for hiding this comment

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

  • Add a new or edit an existing PaleoContext which has a related TectonicUnit
    • No error should occur
  • On the Tectonic Unit form, display the paleoContexts relationship as a Subview and ensure that PaleoContexts can be added, removed, and edited

Working now, not sure what happened before but tectonic unit can be rendered as a subview and search has been removed from dependent querycbx

image

Screenshot 2025-01-10 095558

@emenslin emenslin requested a review from a team January 10, 2025 15:58
Copy link
Contributor

@Areyes42 Areyes42 left a comment

Choose a reason for hiding this comment

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

  • Add a new or edit an existing PaleoContext which has a related TectonicUnit
    • No error should occur
  • On the Tectonic Unit form, display the paleoContexts relationship as a Subview and ensure that PaleoContexts can be added, removed, and edited

Looks good!

@melton-jason melton-jason merged commit f1aa17c into production Jan 13, 2025
12 checks passed
@melton-jason melton-jason deleted the issue-6042 branch January 13, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Adding Paleo Context to COG's child CO causes FieldDoesNotExistError
5 participants