Filtering and Advanced Iteration
In this case study we investigate using data in a data block and filtering the data for display to the user.
This case study builds on the iteration and data storage concepts we introduced in Chapter Five.
This case study covers these major topics:
- lists
- dictionaries
- lists of dictionaries (multidimensional data)
- iteration
- styling using CSS
- include blocks
- table blocks
- using
format()to present strings
ABC Incorporated
We have been engaged by ABC Incorporated, a not-for-profit association that works in the Disability sector.
A lot of ABC's clients are looking for emergency accommodation for various reasons. It may be that they have been evicted for not paying rent, or they may be facing a domestic violence situation, or they simply may not have anywere to stay for a few nights.
ABC have a list of emergency accommodation providers but different providers cater for different kinds of people. For example, some only cater for families, some may only cater for people of a particular gender and so on.
ABC have come to us and asked us to write an app that would present to a user a list of accommodation providers relevant just to them. For example, a single male living at Gepps Cross would only be presented with a list of accommodation providers that cater for single males and located in the north of Adelaide.
ABC can provide us with a list of providers. ABC will need to maintain that list, so we need to make the maintenance process as simple as possible for them.
📄️ Design
ABC's Requirements
📄️ Coding - Introduction
In this part of the Case Study we work through writing the code for the app we have
📄️ Coding - User questions
Ask the user about their circumstances
📄️ Coding - List of Services
The next part of our design is to set up the data and evaluate it. This is a rather
📄️ Coding - Evaluate against criteria
This part of our app is the most logically complex part. It's going to take us some
📄️ Coding - Display relevant services
There are two parts to this part of our app:
📄️ Source Code Library
main.yml