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 a ResourceLinks model #101

Merged
merged 3 commits into from
Jan 18, 2021
Merged

Add a ResourceLinks model #101

merged 3 commits into from
Jan 18, 2021

Conversation

egiurleo
Copy link

I realized that innovative policy idea and honorable mention objects are essentially Links -- they link to an external URL and are associated with subcategories.

I want to create three types of Links using single table inheritance. The first is the traditional link, which I'm calling a ResourceLink. A subcategory can have any number of resource links, and we tell which ones are still being used based on their active field.

Two more links, HonorableMentions and InnovativePolicyIdeas will come in a follow-up PR. These will behave differently than ResourceLinks, which is why I'm making them separate classes.

@egiurleo egiurleo requested a review from brittanylau January 15, 2021 02:26
Copy link
Contributor

@brittanylau brittanylau left a comment

Choose a reason for hiding this comment

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

This is so cool!!! 🤩

Will we have to update the /links endpoints use the new resource links in the future?

app.py Outdated
Subcategory,
Criterion,
Link,
ResourceLink,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this import being used?

Copy link
Author

Choose a reason for hiding this comment

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

Nope :) I'll get rid of it.

@egiurleo
Copy link
Author

@brittanylau Good call! I made #105 so we remember to update the API once CMS work resumes.

@egiurleo egiurleo merged commit 9f65df1 into main Jan 18, 2021
@egiurleo egiurleo deleted the resource-links branch February 8, 2021 03:03
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