Closed mcab closed 5 years ago
We're actually pretty close.
/api/v1/schema
isn't returning the proper routes, though. This can be bypassed with a static generation, but probably understanding why it's not generating in the first place is more important.
Additionally, this is ReadOnly for now.
I've been working on this for a bit.
ArrayFields
~.ImageRenditionField
.The bottom two would probably be fixed if we used Wagtail's API, but I'm iffy on the declaration on how to get data from it. Since Bat
is a Django model, we should stick to using that instead of going through Wagtail's API.
Also, the ArrayField and mapping seems a bit weird. Internally, DRF sees it as a ListField, but there's no way to link the items in the List to their human-readable equivalent. It still probably uses get_FOO_display(), it's a matter of calling it properly.
We ended up being able to serialize values back to their human-readable counterparts. Definitely not DRY, but since there is no way to pass which field needs the proper counterpart, I guess this is okay™.
In order to at least have a basis for the API endpoint / structure, I'm changing this to at least have one model exposed over API.
This is so we can address #11, knowing we have an endpoint for our API.
Addresses #8.
Since we'll be using this with mcab/flightplan, we need a way to communicate the data.
This is the scaffolding for such.