-
-
Notifications
You must be signed in to change notification settings - Fork 137
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 REST API functionality for generating menus #302
Open
ababic
wants to merge
153
commits into
jazzband:master
Choose a base branch
from
ababic:menus_api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #302 +/- ##
==========================================
- Coverage 98.26% 93.44% -4.82%
==========================================
Files 89 94 +5
Lines 2945 3465 +520
==========================================
+ Hits 2894 3238 +344
- Misses 51 227 +176
Continue to review full report at Codecov.
|
Closed
ababic
force-pushed
the
menus_api
branch
4 times, most recently
from
June 19, 2019 21:47
c0ba2ee
to
cade063
Compare
ababic
force-pushed
the
menus_api
branch
13 times, most recently
from
July 9, 2019 10:28
d3f6977
to
f2c4ffb
Compare
ababic
force-pushed
the
menus_api
branch
11 times, most recently
from
July 30, 2019 09:41
1eeb2b6
to
560a91f
Compare
…dation - Added '_id' to the end of all page fields to reinforce that an ID value should be supplied - Make apply_active_classes False by default - Make ChildrenMenuGeneratorArgumentForm.parent_page required
…rlializer classes
…ation (for menus, menu items and menu item page data)
…our of specifying directly on the class
…gs() and remove 'base_class' as the first parameter
… menu item classes
…ITE_MODE to simplify things for single-site projects
…ribute names - Use ImproperlyConfigured errors instead of NotImplementedError in views
…sion_classes and renderer_classes for menu generator views
- Replace custom form fields with serialiser fields - Move default option value handling to option serializers from views - Make option serializers swappable via settings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #278.
To do list:
There are endpoints for generating the following menu types:
Each endpoint acts in a similar way to the equivalent template tag, only rendering the menu as JSON instead of to a template. If you're familiar with the tags, you should recognise the options that are available in the API. You just have to provide a few more values, as there's no existing request context to pull existing values from.
The best way to see how they all work is to check out each one in the Browsable API view, where an 'Arguments' form will explain all of the arguments accepted for each view.
Anyone wanting to give this a whirl for themselves should be able to do so by following these instructions:
'wagtailmenus.api'
toINSTALLED_APPS
in your project's settings'rest_framework'
toINSTALLED_APPS
in your project's settingsurls.py
for your project to include thewagtailmenus.api.urls
, e.g:v1
index URL in your browser with?format=api
on the end to get the Browsable API view, e.g:http://127.0.0.1:8000/wagtailmenus_api/v1/?format=api
Or, if you want to try things out without interfering with an existing project, you can clone my branch and follow these instructions to get a version up and running:
https://wagtailmenus.readthedocs.io/en/latest/contributing/index.html#developing-locally