Day 5: TGIFlask

Roo Harrigan
Making Athena
Published in
2 min readOct 31, 2015

>>> Brief summary

Each morning at Hackbright between lecture and project time, we break up into small groups for a quick scrum, except it’s a rather odd scrum because everyone is working on completely disparate projects. When I got ready to speak my three sentences (yesterday’s accomplishments, today’s goals, blocks) I realized I was most excited that I’d put the messy database seeding behind me and could get back to Flask. Dirty data can really get you down.

I knocked out a quick HTML page for displaying a user’s quiz score (not that I can calculate it yet), read up on the random module to deal with display my quiz multiple choice answers in different orders (thanks, sample()!), worked on fleshing out my User class, and conceptualized a “Quizevent.” Then I started working on sending the user’s selected answer guess back to a Flask route (and into my database) and things got hairy. Well, actually…

>>> Where I struggled

My sticking point today looked like Cousin Itt but turned out to just be Lurch. I made a small error when writing my quiz_questions.html form that caused me to make a lot of changes:

  • adding, removing, and adding back in <label> tags for each button
  • adding </input> close tags and removing them again.
  • fretting that my {{ answer1 }} Jinja variables might not be allowed to be sent back with my form
  • making a new form for each button and fretting about getting them all back to the same route
  • changing my buttons to radio buttons (probably utility-wise the right decision but I hate clicking radio buttons)

It turned out that I’d forgotten to put in ‘=’ signs for my value = “answer1” parameters in my <input> tags. When I finally gave up and went home, my boyfriend found it in 30 seconds, and of course the jinja variable doesn’t matter at all (what comes back is in the value= “” parameter).

The Addam’s Family provides a nice hairiness scale: Fester → Lurch → Itt

>>> Thoughtful takeaway

Start by checking for syntax errors before assuming something more heinous is going on. In fact, as I was working on it today, that spiraling-out-of-control-what-if-I-don’t-actually-know-anything feeling was something I should recognized as an indicator that I probably had a syntax error, and not that everything I thought I knew was wrong and I may as well delete the whole html page and Flask route and just start again.

I know quite nearly nothing, at this stage, about real programming.

But as it turns out, nearly nothing is quite a bit more than nothing at all.

--

--