Closed frowenz closed 11 months ago
An open question I am unsure about is: given that these will be permanent things in our data base, is using fixtures the best approach?
One thing left to do maybe when Category CRUD pages appear is to refine the way the descriptions are stored. This involves implementing more intelligent parsing. Currently, a lot of BGG descriptions have bullet points which we are ignoring and occasionally have BGG specific things.
See this page and the following description as an example:
"description": "Medieval games that have themes or storylines set in Europe or Asia, between the 5th century (476, the fall of the Western Roman Empire) and the 15th century (1492, the beginnings of European overseas colonization).\n\n\nHistorical categories on BGG:\n\n\n Ancient\n Medieval\n Renaissance\n Pike and Shot\n Age of Reason\n Napoleonic\n Post-Napoleonic\n World War I\n World War II\n Korean War\n Vietnam War\n Modern Warfare\n\n\nNorth America:\n\n American Revolutionary War\n American Civil War\n American Indian Wars\n American West\n\n\n\nMicrobadge\n\n Medieval Theme fan",
This sort of advanced parsing lies outside the scope of just getting basic Category and Mechanic fixtures up.
python3 manage.py testserver src/chigame/games/fixtures/mechanics_categories_fixtures.json
to run
On whether these should be fixtures given that they're permanent in the database, I think it's fine because we can always load them into the database with python3 manage.py loaddata src/chigame/games/fixtures/mechanics_categories_fixtures.json
Closing comments: this issue resulted in the creation of a fixture file for all of the categories and mechanics (with descriptions and images) that are listed on BoardGameGeek.
Developer contributions: @frowenz wrote the whole script to create the fixture file and made all the requested changes in PR #236 @willcravitz just confirmed that the file worked and left some minor comments
Issue Score: Excellent
Comments: Great work y'all! Thank you to you both for actually discussing the updates, questions, and answers via the issue updates. Great closing comment @willcravitz @frowenz thank you for all of your work making the functional (and very useful) script for scraping the fixtures! Super cool work.
The goal of this issue is convert the information on these pages, categories and mechanics, into fixtures. This will require creating a web scraper, turning the scraped data into fixtures, and adding an image attribute to these models.