Day4
At the end of class, I checked in with Lux about my progress with my program (app launched, association selection button created, purposes multi-select buttons made, grants stored in dictionaries…)
She told me it looked good, so I felt pretty solidified with my approach to my program.
At home, I went further coding my program:
- I created generate_results(), a function generating suitable grant(s) based on the user’s chosen purposes.
- I made a dictionary containing all of the grants’ titles as keys and their application links as values.
- I used this dictionary to create link buttons for each generated result.
During my work creating generate_results(), I realized that the organization of the grant dictionaries (keys: titles of grants, values: list of their purposes) didn’t work. My function needed to access the purposes to compare with the purposes selected by the user, but I had no way of accessing them because they were stored as values. So I recreated my grant dictionaries with the keys as purposes and values as grants covering the purpose (sigh… This was very very tedious and time consuming. I even thought of the possibility of creating a program to do it.) But the process was totally worth it because the change allowed me to simplify the process of creating the pill buttons (instead of using a separate list of grant titles, I could just use grants.keys())!
Also, during my worktime, I encountered a problem where my app would not reload (at one point, the page just didn’t reappear when I refreshed it. It just kept loading for a long time and telling me an error occured.) I found a temporary solution to this by rebooting the app, (I don’t know what effect it had on my program, though.) but I still haven’t found the reason for the issue. I think it may be linked to caching and too much copied data every time the app is refreshed..? But I will need to look into it and possibly talk to Lux about it as well.
For next time:
- Solve key error type B that is arising when some pill buttons (purposes) are selected
- Get rid of error that arises when no pill buttons (purposes) are selected
- Check out caching and rebooting
- Find how to generate results for multi-selections