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

Initial static text url_for implementation #1004

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dave42w
Copy link

@dave42w dave42w commented Oct 28, 2024

Description

This PR starts the process of implementing url_for so that Jinja templates can reference Robyn endpoints by function name rather than path see #996

Summary

This PR adds a url_for that returns a fixed string and a test for this.

Changes are limited to 3 files

  • templating.py (define the url_for function and add it to the global Jinja environment)
  • template.html (display the output of url_for
  • test_get_requests.py (add an assert to check the fixed string)

PR Checklist

Please ensure that:

  • [X ] The PR contains a descriptive title
  • [ X] The PR contains a descriptive summary of the changes
  • [ X] You build and test your changes before submitting a PR.
  • You have added relevant documentation (I've added a docstring, until we get to the point where it can be used in a functional way I've not added it to the main documentation)
  • [ X] You have added relevant tests. We prefer integration tests wherever possible

Pre-Commit Instructions:

  • Ensure that you have run the pre-commit hooks on your PR.
    I think I've done that. I'm running the tests from a separate clone which I have had to modify to work with Python 3.12.7 (updated dependencies are the only changes)

Copy link

vercel bot commented Oct 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
robyn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 10:33pm

Copy link

codspeed-hq bot commented Oct 28, 2024

CodSpeed Performance Report

Merging #1004 will not alter performance

Comparing dave42w:url_for (6b907b2) with main (deea29a)

Summary

✅ 145 untouched benchmarks

@dave42w
Copy link
Author

dave42w commented Nov 1, 2024

I'm stuck. See #996 (comment)

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.

1 participant