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

Add search fields to endpoints that lack them #313

Merged
merged 17 commits into from
Oct 2, 2023
Merged

Conversation

greshdev
Copy link
Contributor

@greshdev greshdev commented Aug 5, 2023

Ensured that all ViewSets (aside from Manifest, Search, User and Group) had search fields for name and description (DocumentViewSet uses title instead of name). This involved adding search_fields for name and desc to all ViewSets that lacked search fields and adding a search field for desc to all ViewSets that only had name.
This should fix the bug identified in issue #301.

@augustjohnson
Copy link
Collaborator

Hey @greshdev I just merged in #314 and I think that's causing the conflicts on this. Can you resolve them and add another commit?

Thanks!

@greshdev
Copy link
Contributor Author

greshdev commented Aug 7, 2023

Thanks! I think that should fix it, let me know if there's still any issues.

@eepMoody eepMoody merged commit 3f1aeb3 into open5e:staging Oct 2, 2023
eepMoody added a commit that referenced this pull request Oct 27, 2023
* Thoughts laid out on Models.

* Clarifying Sets.

* Forgot carrot.

* Update models.md

* Adding the object model.

* Polishing object, to allow nulls.

* Comment typo.

* Adding an item and itemset.

* Adding init for models folder.

* Adding some stubs.

* More models v2 being added.

* Running without custom validators.

* Adding views.

* First pass at v2 logic.

* Conditionally adding admin when debug is true.

* Adding magic item type.

* Structural changes to models

* Running.

* Keys.

* Progress on export.

* Dump is now structured correctly.

* symmetric loading and unloading.

* cleanup.

* Adding licenses output, single file.

* Root definitions.

* Document items have a key.

* Renaming and ruleset.

* refactoring to weapon and armor.

* Adding some basics.

* whitespace.

* More refactoring to get rid of Org

* Pulling magic fields into item.

* Adding licenses.

* One document, multiple licenses.

* Removing prefix.

* Adjustments.

* Adding additional data.

* Whitespace, and url.

* Adding filtersets.

* Comment changes.

* Adding appropriate item filters.

* Removing unnecessary props.

* Bad merge

* Adding import and export.

* Making some progress on magicitems.

* Progress

* Adding many more magic items.

* Adding figurines.

* Added the Ioun Stones.

* Adding potions of giant strength.

* Adding spell scrolls and removing old magic items.

* Adjusting quicksetup to add v2 data

* Adding artifact rarity.

* Reordering for a cleaner export.

* Fixing output message.

* Stubbing out Itemset.

* Added trade goods and itemsets.

* Tweaking itemsets.

* Reverse pk doesn't  make any sense.

* Adjusting items to simple/full standard.

* Adding properties and filters

* Tweaking responses.

* Adding in rulesets.

* Adding filters.

* Missed the word Name in fields.

* Missed description as well.

* Adding test router.

* Added poisons.

* Adding adventuring gear.

* Fixing magic and adventuring gear added.

* Adding items and itemset for focuses and others.

* Adding packs.

* Fixing sort order.

* Collapsing migrations.

* Documenting the Data for v2.

* Update README.md

blockquotes -> code blocks in readme

* Adding Kobold Press Vault of Magic.

* Updating key to be long.

* Tweaks.

* Adjusting folder name.

* Readme Improvements (#289)

* docs: simplify installation

* docs: readme logo and styling

* docs: fix centering

* docs: install, build, deploy, ToC

* docs: bash code tags

* docs: expand contributing

* docs: simplify installation

* docs: readme logo and styling

* docs: fix centering

* docs: install, build, deploy, ToC

* docs: bash code tags

* docs: expand contributing

* docs: minor corrections

* cleanup document titles to remove "ogl", standardize on "5e" (#293)

* cleanup document titles to remove "ogl", standardize on "5e"

* add ™ where needed

* Data/284 update adventuring equipment (#294)

* added missing copy: equipment list

* added missing table to adventuring gear section

* fix: update srd madness/traps section to fix table header display (#298)

* Add raw size field to all races (#299)

* models: add raw size to races

* migrations

* parsing fun.

* fixes.

* Removing the partials, consolidating into item.

* Collapsing migrations.

* iterating versions.

* Removing an unecessary package from lock.

* Adding support for /version endpoint.

* Adjustments to use REF and SHA.

* 158 search with empty text string literally returns all results which is expensive (#303)

* Now there is no response to empty query on search.

* Updating env.

---------

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>

* Whitespace.

* Updating pipfile seems to fix.

* Correction of Goblin Specialists CR to 1/2 from 1 (#307)

See A5E MM Page 250 for details.

* Add missing bracket (#306)

* Replace unicode bullets with asterisks

Bulleted lists in monster ability descriptions are now markdown-formatted.

* Create "Misellaneous Creatures" and "NPCs" groups

Assign monsters from "Appendix MM-A: Miscellaneous Creatures" and
"Appendix MM-B: Nonplayer Characters" in the 5e SRD to their
respective groups.

* Refactor view filtersets:
Extract CommonFilterSet base class for all filtersets to extend;
Add document__slug__not_in field filter to CommonFilterSet;
Move filtersets to seperate filters module;

* Bugfix for array properties becoming an empty string when empty (there might be more properties that need the same fix, needs a second look)

* Adding key and reusable method.

* Large changes to support depth.

* More work with Depth.

* Removing unnecessary setting.

* v2 flag

* Registering routers if v2 is on.

* Setting v2 enabled to debug.

* This should work for dev and production.

* Found one more array to default to "null"

* Simplifying how key and url are sent.

* Maintaining depth, but forcing props.

* Created DynamicFieldsHyperlinkedModelSerializer base class

* Inheritance from DFHMS for classes that previously
inherited from both DFMS and HMS, as well as classes that only
inherited from HMS, in order to provide dynamic field serialization
on those classes.

* Revert "Inheritance from DFHMS for classes that previously"

This reverts commit 70a19d7.

* Inheritance from DFHMS for classes that previously
inherited from both DFMS and HMS, as well as classes that only
inherited from HMS, in order to provide dynamic field serialization
on those classes.
Subrace is left out due to a bug in the DFHMS, which will be fixed in the following commit.

* Fix bug in DFMS (indexing with key that may not exist)

* Implement DFHMS on Subrace

* Merge branch 'staging' into api_v2_items

* Just doing an update.

* Updating tests so that #309 is taken into account.

* Update build_and_deploy.yml

* Backfill from Main

* a5e - spells

* a5e - spell classes

* a5e: add spell slugs

* option to import slug from spell json

* a5e: add spell saving throw and shape

* a5e: add attack roll to spells

* Fixed more Hellfire armor issues

* Got through A-Cs. Made some global changes.

* Got through the Es. Fixed some other formatting issues.

* Bone devil had the  wrong cr.

* a5e: use numerical ranges to fit new schema

* spells slug import v2

* a5e: add self as default range

* task: Add pytest as the test runner for the project.

* task: Update README installtion instructions to install pipenv dev dependencies.

* Up through Hs. Ended at Hallowed Effigy.

* Up through the Ns. Ended at Octopus Bracers

* Adding descriptions based on the SRD.

* Up to Rod of Verbatim

* Up to Shark Tooth Crown

* Added MM-B npcs.

* Importing and exposing.

* Adding parameters.

* Editing a weird leading underscore in desc for tob

* Corrected up to Slimeblade..

* Up to Spider Staff.

* Corrected and updated many Vault of Magic items. Did a full skim-through comparing it to the PDF. Oof!

* Fixed JSON error.

* Found a bunch of other fixes to "varies" items.

* Added Barbarian subclasses

classes.json & document.json

* Update classes.json

Added Errata 02/01/2023 changes to Barbarian's "Roar of Defiance"

* Update classes.json

1. Added Bard & Cleric subclasses.
2. Italicized the bold text for player choice options to match the standardized formatting.
3. Italicized spells, the 'x' multiplier symbol, and other words as indicated in the source material.
4. Added Errata 02/01/2023 changes for Bard & Cleric subclasses.

* Update classes.json

1. Fixed a few formatting errors.
2. Added Druid subclasses.
3. Added Errata 02/01/2023 changes for Druid subclasses.

* Update classes.json

1. Added Fighter, Monk, & Paladin subclasses.
2. No Errata 02/01/2023 changes for Fighter, Monk, & Paladin subclasses.

* Update classes.json

1. Added Ranger subclasses

* Removed underscores around spell names.

* fixed wand of vapors

* task: Update the README with better instructions to run the test suite with pytest.

* Update classes.json

1. Added Rogue, Sorcerer, Warlock, and Wizard subclasses.
2. Removed all subclasses not found in Tome of Heroes.
3. Removed class-level fields.
4. Added Errata 02/01/2023 changes for remaining subclasses.

* Update README.md

* Updated classes.json

Updated with cleaner formatting.

* Adding many filters.

* Charclass

* Added the rest of them.

* Cleaning up a few missed items.

* Everything except the markdown.

* maybe all of them in? Errors probably.

* Adjusting ability.

* Removing a couple more dqs.

* Removing some funky escapes.

* Adding lots of newlines, removing links.

* Added in support for just subclass files.

* Create CODE_OF_CONDUCT.md

* Monster environments (#257)

* exposed monster enviroments to the api

* Removed environment duplicates

* storing json, exposing object.

* Exposing a list.

* adding environments to monster test.

---------




* Create races.json

Added races & subraces + Errata 02/01/2023

* Create spells.json

Added all spells + Errata 02/01/2023

* Introduce versioning to DRF API (#248)

* Updating dependencies to current. (#249)

* Create backgrounds.json (#260)

* Create backgrounds.json

Added backgrounds

* Update backgrounds.json

Fixed some formatting issues.

* Create feats.json (#261)

Added feats from Tome of Heroes.

* Create magicitems.json (#262)

Added magic items from Tome of Heroes by Kobold Press

* task: Add basic tests and fixtures for the spells view. (#263)

* task: Add basic tests and fixtures for the spells view.

* task: Use pytest as the test runner on github actions.

* Handling a blank blank_environment_handling (#266)



* some fixes, not all resolved

* removed subrace-only entries

currently the system cannot ingest subraces-only. Removed the gnome, dwarf, and halfling subrace additions. Once we solve this, they could be added in a future version.

* Update spells.json

"Tree Heal" had no class specified. I contacted KP and they clarified it was Druid only.

* Create races.json (#259)

* Create races.json

Added races & subraces + Errata 02/01/2023

* some fixes, not all resolved

* removed subrace-only entries

currently the system cannot ingest subraces-only. Removed the gnome, dwarf, and halfling subrace additions. Once we solve this, they could be added in a future version.

---------



* A few QOL enhancements

Striving for similarity across formatting.

* Api v2 items (#271)

* Thoughts laid out on Models.

* Clarifying Sets.

* Forgot carrot.

* Update models.md

* Adding the object model.

* Polishing object, to allow nulls.

* Comment typo.

* Adding an item and itemset.

* Adding init for models folder.

* Adding some stubs.

* More models v2 being added.

* Running without custom validators.

* Adding views.

* First pass at v2 logic.

* Conditionally adding admin when debug is true.

* Adding magic item type.

* Structural changes to models

* Running.

* Keys.

* Progress on export.

* Dump is now structured correctly.

* symmetric loading and unloading.

* cleanup.

* Adding licenses output, single file.

* Root definitions.

* Document items have a key.

* Renaming and ruleset.

* refactoring to weapon and armor.

* Adding some basics.

* whitespace.

* More refactoring to get rid of Org

* Pulling magic fields into item.

* Adding licenses.

* One document, multiple licenses.

* Removing prefix.

* Adjustments.

* Adding additional data.

* Whitespace, and url.

---------



* Add telemetry and hide v2 apps (#272)

* add newrelic telemetry

* hide v2 paths while in development

* clear API key for test

* try to get it to pick up our license key

* push up correct config for logging

* oops

* trying something crazy

* maybe?

* welp not sure

* Additions for ToH & fixes for WOTC + Open5e_original files (#269)

* Added ToH content + fixes

Fixes:
backgrounds.json

New:
armor.json
spells.json
weapons.json

* Few formatting fixes

open5e_original -> backgrounds.json
WOTC_5e_SRD_v5.1 -> armor.json

* Added adventuringgear.json

This is broken down from sections.json to be more like other files where multiple sources can be appended on one webpage and alphabetized if needed. Original design is a large paragraph in sections.json.

* Update adventuringgear.json

Removed the text "(described later in this section)" because it does not apply for this.

* Monster type normalization (#264)

* Normalized monster types across Kobold Press books

* Normalized monster types across Kobold Press books

* Update data/WOTC_5e_SRD_v5.1/monsters.json

* Update data/WOTC_5e_SRD_v5.1/monsters.json

* Update data/WOTC_5e_SRD_v5.1/monsters.json

* Update data/WOTC_5e_SRD_v5.1/monsters.json

* Update data/WOTC_5e_SRD_v5.1/monsters.json

* Apply suggestions from code review

* Apply suggestions from code review

* Apply remaining "swarm"s

---------



* add serializer methods to avoid errors on json-based fields (#275)

* add serializer methods to avoid errors on json-based fields

* fix copy/paste error

---------

Co-authored-by: Sturlen <43607012+Sturlen@users.noreply.github.com>
Co-authored-by: mshea <mike@mikeshea.net>
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: guizesilva <31866341+guizesilva@users.noreply.github.com>
Co-authored-by: Jonathan Lawrence <jonathanlawrence813@outlook.com>
Co-authored-by: August Johnson <augustjohnson@users.noreply.github.com>
Co-authored-by: Tim Basten <tbasten@gmail.com>
Co-authored-by: David Prothero <david@prothero.com>
Co-authored-by: Jonathan L <47407031+JonathanELawrence@users.noreply.github.com>

* a5e magic items (#304)

* content: a5e magic items

* a5e magicitems - components and requirements

* a5e magicitems -cleanup &nbsp

* a5e magicitems - requires-attunement

* Add search fields to endpoints that lack them (#313)

* Add title & desc search fields to DocumentviewSet

* Add desc search field to SpellViewSet

* Add name & desc search fields to SpellListViewSet

* Add desc search field to MonsterViewSet

* Add desc search field to BackgroundViewSet

* Add name and desc search fields to PlaneViewSet

* Add name and desc search fields to SectionViewSet

* Add name and desc search fields to FeatViewSet

* Add name & desc search fields to ConditionViewSet

* Add name & desc search fields to RaceViewSet

* Add name & desc search fields to SubraceViewSet

* Add name & desc search fields to CharClassViewSet

* Add name & desc search fields to ArchetypeViewSet

* Add desc search field to MagicItemViewSet

* Add desc search field to WeaponViewSet

* Add desc search field to ArmorViewSet

---------

Co-authored-by: Gresh <>

* Implement initial Creature model, including Abilities (#317)

* Incomplete Creature model

With sample monsters for testing.

* Implement abilities model

* Create api_v2 versions of every monster from the SRD

Currently includes only attributes and abilities.

* Add creature actions model and data for v2

* Add monster attack action stats

* Add documentation for creature action fields

* Add category, type, subtype, and alignment fields

* Oathless Betrayer subclass (#318)

* Oathless Betrayer subclass 

This Paladin subclass replaces a similar core subclass not available in the SRD.

You can see a more readable version of the same text on google drive: https://docs.google.com/document/d/18e5u-v-hMFMLr4npr-5I6TNoISlit_-ANpXEcLp2WLU/edit?usp=sharing

* sorting issue

Paladin class is coming up first in sorting in test environment, adding in empty classes to try and fix this.

* Fix CR values for TOB3 (#320)

Co-authored-by: Thomas Visser <tvisser@newstore.com>

* Stoor Halfling subrace (#326)

* Stoor Halfling subrace

This Halfling subrace replaces a similar core subrace not available in the SRD.

* fix sorting

* Storm Domain subclass (#322)

This Cleric subclass replaces a similar core subclass not available in the SRD.

You can see a more readable version of the same text on google drive: https://docs.google.com/document/d/1EEK60ost_TPVtUBrUBY1lmtTlbir8oAZEJD7T7s7Qbg/edit?usp=sharing

Co-authored-by: Ean Moody <moody.designer@gmail.com>

* Update monsters.json (#324)

Fixed error in data for 2 entries
Ticket #323

* section search queries now return 'parent' field (#325)

* Api v2 feat race (#321)

* Adding basic feat and race models.

* Whitepace and verbose name edits.

* Renaming for clarity

* Adding feat and race to the endpoints

* Exposing Races

* Exposing the model admin correctly.

* exposing traits.

* fixing is_subrace boolean.

* Whitespace and documentation.

* Adding in race data.

* Adding Tome of heroes Races.

* Adding srd feat.

* Adding a5e feats.

* Need to add the ruleset manually.

* Making Trait use generic Benefit.

* Changed races over to an abstract.

* Adds selectable bool.

* didn't need this in a separate file.

* Renaming prerequisite_desc to prerequisite.

* Adding has_prerequisite property.

* Adding a couple of utility fields to feats.

* adjustments to feats model.

* Update views.py

* added closing bracket to storm domain.

---------

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Ean Moody <moody.designer@gmail.com>

* Hraesvelgr alignment (#328)

* Tal'Dorei Campaign Setting subclasses (#329)

* Create document.json

This is a weird one because the book is no longer being sold directly by the original publisher. I opted to include a link to a blog post from the publisher about the book, which contains a link to where the product used to be listed on the store; the link currently redirects to Green Ronin's other 5e products. You can find the original store link on archive.org, for instance: https://web.archive.org/web/20191230102305/https://greenroninstore.com/collections/fifth-edition/products/critical-role-tal-dorei-campaign-setting-5e-pdf

Under OGL Lines, I did not reproduce the entire OGL license in full (should I?), but I did include the product specific paragraphs from the license page: the copyright notice, the declaration of Product Identity, and the declaration of Open Content.

* Barbarian Path of the Juggernaut

Removed most of introduction to avoid references to Product Identity

* Cleric Blood Domain

also removed some extra spaces from the Path of the Juggernaut description

* Sorcerer Runechild

* Monk Way of the Cerulean Spirit

The name of this subclass included the proper name of an organization and thus should be considered Product Identity, so I changed it to something similarly evocative as the original.

* adding directory to quickload.py

* edit slug

* fixed capitalization

* adding backgrounds

'Crime Syndicate Member' and 'Elemental Warden' are renamed to remove proper names which are Product Identity. PI has also been removed from various descriptions.

* adding a few NPCs

Adding the four NPCs I've dubbed "Elemental Wardens" to avoid using Product Identity. These correspond to one of the player backgrounds.

* fix bad formatting

* additional fixes

changing cr to numeric, removing non-OGL spells, bonus_actions seem to be required for reactions

* magic item - skysail

referenced by skydancer NPC's abilities

* feats - rapid drinker

* Add bonus actions to Monster

* migrations

---------

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: August Johnson <augustjohnson@users.noreply.github.com>
Co-authored-by: Sturle Spetland <43607012+Sturlen@users.noreply.github.com>
Co-authored-by: calum <47755775+calumbell@users.noreply.github.com>
Co-authored-by: A. Stadler <adamv.stadler@gmail.com>
Co-authored-by: Namtrah Kcirt <13903735+namtrah@users.noreply.github.com>
Co-authored-by: jakdevmail <140275384+jakdevmail@users.noreply.github.com>
Co-authored-by: Michael Groufsky <m.groufsky@gmail.com>
Co-authored-by: Gresh <>
Co-authored-by: denizaydin <deniznaydin@gmail.com>
Co-authored-by: mshea <mike@mikeshea.net>
Co-authored-by: guizesilva <31866341+guizesilva@users.noreply.github.com>
Co-authored-by: Jonathan Lawrence <jonathanlawrence813@outlook.com>
Co-authored-by: Tim Basten <tbasten@gmail.com>
Co-authored-by: David Prothero <david@prothero.com>
Co-authored-by: Jonathan L <47407031+JonathanELawrence@users.noreply.github.com>
Co-authored-by: greshdev <40521807+greshdev@users.noreply.github.com>
Co-authored-by: Michael Groufsky <wardsky@users.noreply.github.com>
Co-authored-by: Nicholas Stefanski <nmstefanski@gmail.com>
Co-authored-by: Thomas Visser <thomas.visser@gmail.com>
Co-authored-by: Thomas Visser <tvisser@newstore.com>
Co-authored-by: Eric Demers <aljovinglobal@hotmail.com>
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.

3 participants