End of Week 1
Today's the end of week! Honestly every day at the Dojo goes by really fast. The assignments don't really end and when you think you mastered everything you learn in one day, the next assignment or chapter will start barraging you with that much more information. The pace of the Dojo is honestly up to the individual. You can get a lot of things done, or you can fool around a bit and have to finish assignments longer.
We're supposed to have finished Flask today and move onto MySQL + Flask. I kinda accomplished that, I got to the last assignment and got stumped (but eventually figured out! More on that later). The Ninja Gold assignment was pretty fun to do and I learned how to use datetime as a module. Ninja Gold is a basic app that allows you to click a button for 4 different buildings, each building giving you money or in one case, might also take away money. You have a gold counter at top and an activities log on the bottom. Tricky part about this assignment was to figure out how to create a message log for all activities, since showing one message is relatively easy. Maric recommended me to do a list or dictionary and I chose the former. Here is the result:
I didn't really do much CSS on this page since the main part of the project was to figure out how to create 4 inputs on the HTML that links to one app.route(using the hidden type) that puts out 4 different scenarios (all done with if and elif statements). I definitely should go back and make my projects more appealing for my GitHub account.
The last thing about Flask we learned today was validation and flashing messages and advanced routing. Validation is just having the server read what the user input is and comparing it with what is supposed to be; i.e. passwords must be longer than 8 characters, password must contain 1 uppercase etc. I tried to develop my own method outside of the password regex but alas Kris just told me to google regex since it's so much simpler.
Advanced routing was where I got stuck on, which is why I got stuck on the last assignment. Now, advanced routing is just using a variable and putting it as a parameter in our app.route() as well as our function within the route and the resulting render_template or redirect. I didn't really understand the assignment until I realized that the changes between pictures or HTML elements are due to the URL of the browser.
Here's what I've learned in the past week:
- Basic Python syntax/algorithms.
- Python OOP including lambda functions.
- Flask fundamentals
No comments:
Post a Comment