Added "armor_detail" to Creature model
#662
Merged
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.
Description
This PR adds the
"armor_detail"field to the V2 Creature model, replicating the functionality of the "armor_desc" field of the V1 Monster model.This field is designed to hold the data in a monster's statblock that sometimes follows their armor class in paratheticals ie. the (natural armor) tag in the WotC 5.1 SRD Aboleth statblock.
Additional work was undertaken to convert all existing v1
"armor_desc"data to v2"armor_detail". A simple Python script was written to achieve this. I have included this as part of my PR so we have a record of it, but is not run as part of any automated build/setup step, was only designed to be executed once from the command line, and can be deleted should we choose.Type of Change
Enchancement (adding back missing V1 feature)
Related Issue
Closes #600
How has this been tested?
The fix was first tested by spinning up a local Django test server and poking around the
/v2/creaturesendpoint. Monsters from many different source documents were examined this way.Because this PR changes the shape of the API response of anything with an armor class, running
pytestflagged several tests as failing. Once the test cases were updated to better reflect the new shape of the API response, all tests were passing.Notes
Once this PR has been merged to
staging, we will want to update the front-end to display this additional information on the/monsters/[id]route