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

Tree taxonomy #1788

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Tree taxonomy #1788

merged 2 commits into from
Aug 2, 2023

Conversation

actlikewill
Copy link
Contributor

@actlikewill actlikewill commented Jul 14, 2023

  • adds tree taxonomy

image

@actlikewill actlikewill force-pushed the taxonomy-tree branch 4 times, most recently from 5280df3 to 6072b06 Compare July 19, 2023 17:50
@actlikewill actlikewill force-pushed the taxonomy-tree branch 3 times, most recently from c3e747c to 4c97572 Compare July 26, 2023 17:22
@actlikewill
Copy link
Contributor Author

@longhotsummer @goose-life Still a few things I'd want to add. Particularly, the toc filter needs a way to mark active or inactive states, which I think needs a custom JS component.

package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@actlikewill actlikewill force-pushed the taxonomy-tree branch 3 times, most recently from a65389c to 37d2f6d Compare July 28, 2023 05:04
@actlikewill actlikewill force-pushed the taxonomy-tree branch 4 times, most recently from 41b5630 to 1a7183d Compare July 28, 2023 13:29
@actlikewill actlikewill force-pushed the taxonomy-tree branch 2 times, most recently from d7a5f24 to 6a617b9 Compare July 31, 2023 12:38
@actlikewill actlikewill force-pushed the taxonomy-tree branch 4 times, most recently from 4e28c88 to 8f5c2ab Compare July 31, 2023 15:29
if vocabulary.level_1:
log.info(f"Creating child node {vocabulary.level_1}")
child_1 = TaxonomyTopic.add_child(root, name=vocabulary.level_1)
for work in vocabulary.works.all():
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're over-thinking this. If vocabulary has a level_2, then the works are tagged at the second level. Otherwise, they're tagged at the first level.

See here how level_1 is duplicated when there is a level_2:

image

So you only need to apply EITHER level_2 (if it's not blank) OR fall back to level_1. Not both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated 👍

@actlikewill actlikewill merged commit 5e796aa into master Aug 2, 2023
6 checks passed
@actlikewill actlikewill deleted the taxonomy-tree branch August 2, 2023 09:09
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.

3 participants