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

Feature/sckan-279 - Admin interface changes for region + layer #255

Merged
merged 6 commits into from
Apr 5, 2024

Conversation

D-GopalKrishna
Copy link
Contributor

@D-GopalKrishna D-GopalKrishna commented Apr 4, 2024

Jira ticket - https://metacell.atlassian.net/browse/SCKAN-279

AE -> AnatomicalEntity

Task description:

  • Allow to add Synonyms from AnatomicalEntityMeta and AnatomicalEntityIntersections.
  • Added a custom form to this. And allow a charfield with comma separated values as synonyms.
  • This then triggers a post_save - django signal that saves Synonyms if it is passed along while saving.

  • Add Synonyms to AnatomicalEntity in another tab. In AE - we can also create new simple entities (AEMeta) or RegionLayer Combinations, and link synonyms to them to create a AE.
  • Can create a region layer combination (but they are not AE)
  • Can create a region or a layer (But they are not AE - they are AEMeta)


Acceptance criteria (from the Jira Ticket):

  • allow the admins to add a region through the admin interface - ✅ - already available.

  • allow the admins to add a layer through the admin interface - ✅ - already available.

  • allow the admins to add/edit a synonym for an anatomical entity (region, layer) - 🟠 - Done in this PR. Changes being - since Synonyms are connected to AnatomicalEntity - We cannot directly have synonyms for Simple AE/Region/Layer. Rather we have a custom form to get synonyms for AEIntersections and Simple Entities (AEMeta) and save them in AnatomicalEntity.

  • allow the admins to add an intersection region+layer through the admin interface - ✅ - already available.

  • allow the admins to pick for origins, vias, destinations either a simple anatomical entity or an intersection region+layer. - ✅ - already available - Users can pick the Anantomical Entities in origins, vias, destinations.

@D-GopalKrishna D-GopalKrishna marked this pull request as draft April 4, 2024 06:03
@D-GopalKrishna D-GopalKrishna marked this pull request as ready for review April 4, 2024 13:28
@D-GopalKrishna
Copy link
Contributor Author

@zsinnema we do need this ->

def get_model_perms(self, request):
        return {}

to register the AnatomicalEntityMetaAdmin to be referenced by AnatomicalEntityAdmin.autocomplete_fields.

@D-GopalKrishna
Copy link
Contributor Author

Brought back this here - since when saving AnatomicalEntities empty - it gave error with the a if () else b logic. Because indeed in that case it is not any of the two.

Additional FYI - I tried to add a constraint to not allow both to be empty. But still didn't work.

image

backend/composer/admin.py Show resolved Hide resolved
backend/composer/admin.py Show resolved Hide resolved
@zsinnema zsinnema merged commit 30f4030 into develop Apr 5, 2024
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.

2 participants