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

link olid macro #9348

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

psyren99
Copy link

@psyren99 psyren99 commented May 28, 2024

Closes #2283

Create a macro for linking to an OLID

Technical

/macros/OLID.html added
/plugins/upstream/models.py

Testing

/plugins/upstream/tests/test_models.py

Screenshot

Stakeholders

@mekarpeles mekarpeles added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Jun 17, 2024
$def with (q="#")

$ edition = query_param('edition', q)
$ results = find_matches(olid, q)
Copy link
Member

@mekarpeles mekarpeles Jun 19, 2024

Choose a reason for hiding this comment

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

find_matches isn't a public function that's available here. It either needs to be passed in as a parameter, made a @public function, or be added to plugins/openlibrary/code.py as a template global: https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/openlibrary/code.py#L1146-L1171

I think though that find_matches is probably just the wrong function to use. We likely want to use some existing global function to do a web.ctx.site.things get for the specific olid (open library id)

@mekarpeles mekarpeles added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jun 19, 2024
@mekarpeles
Copy link
Member

@psyren99 please see code review comments, see if you can find a @public function anywhere that allows one to fetch a book by olid (openlibrary id). Otherwise, we'll have to create one, possibly in plugins/upstream/models.py

@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jun 30, 2024
@psyren99 psyren99 requested a review from mekarpeles July 2, 2024 23:14
@cdrini cdrini removed the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Aug 9, 2024
@psyren99
Copy link
Author

Is this still open?

@mekarpeles
Copy link
Member

I believe this may need a rebase, then we can throw on testing and if it works, merge :)

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.

Create a macro for linking to an OLID
3 participants