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 views for rendering a static API #23
Conversation
This implements three new views for rendering pages to static JSON files using Wagtail's API module: - ``PagesAPIDetailView`` renders detail pages at ``/api/pages/detail/{id}.json`` - ``PagesAPIListingView`` renders a full page listing at ``/api/pages/{page_num}.json``. Each page contains 20 results. - ``TypedPagesAPIListingView`` renders a separate listing for each page type at ``/api/pages/{app_label}.{model_name}/{page_num}.json``. Unlike the standard listing view, this also includes all specific fields on that page type. All rendering is done through Wagtail's v2 API module so any configuration the site has for that will be used by this static renderer.
Great work @kaedroho ! I'll look at this during the weekend, keep you posted! |
Hi @robmoorman have you had a chance to look at this? Is there anything we can help with? |
@kaedroho can you please update the Configuration and Usage sections of the README to demonstrate how a developer would use the API view? |
He @tomdyson just need to run some extra testing on existing projects, code looks fine (some flake8 minor things though). Should be ready to merge very soon now. |
@kaedroho could you provide some tests as well? |
This implements three new views for rendering pages to static JSON files
using Wagtail's API module:
PagesAPIDetailView
renders detail pages at/api/pages/detail/{id}.json
PagesAPIListingView
renders a full page listing at/api/pages/{page_num}.json
. Each page contains 20 results.TypedPagesAPIListingView
renders a separate listing for each page type at/api/pages/{app_label}.{model_name}/{page_num}.json
. Unlike the standard listing view, this also includes all specific fields on that page type.All rendering is done through Wagtail's v2 API module so any configuration the site has for that will be used by this static renderer.