I did not sleep well at all so I was slow to get out of bed and get dressed. Wayne was still sleeping as well which was unusual but he is still so sore with his back being out. He went to the chiropractor and it’s still too bad for him to do anything. I feel so bad for him!
Jordan didn’t have class today so I told Wayne I’d just take the Max to work. He wanted to give me a ride though. Said it would give him a purpose for the day 🙂 It was another beautiful day. Warm, blue skies. I love it here so much.
As soon as I got to the office Peter messaged to ask how adding data to the DB went but my tmux session was frozen. I really need to figure out how to get out of that situation. It finally quit so I could reconnect. I let him know that I wrote a custom command to do it and it was really cool. He asked if I had gotten events to show up in my template. Nope, not yet but that was my next task.
I tweaked my script a bit and added more events. I also inserted some print statements so I could see what was actually getting passed around. Nothing! Well that’s not very handy. I figured I’d clear out the database and start over since I tweaked it anyway so I flushed the data and added more events. I tried to load the template again and still nothing. Well what the heck? I started a shell session and poked around. I could see that I had events. Think, think, think……Oh! I have to STAR some events! Duh! I did that and now I was seeing events in my list. Yay! But I was still getting errors.
The error had something to do with the url reverse lookup not finding the event slug. I was creating one when I created my events though. I looked at the list of events and it only contained the title. I figured I should just flush the database again and start over. I sent the flush command, it asked if I really wanted to delete all of the data, I said yes and then it hung. What the heck?? I couldn’t do anything so I closed the tab and tried again. Same thing. Lunch arrived at about this time so I figured I’d leave it until after I ate. Katt ordered Sizzle Pie and it was yummy!
I came back and it was still doing nothing. Why is everything such a pain in the ass? I started looking through my other terminal tabs though and yeah, I had never closed out of the shell session I was using before. Doh! Once I exited I was able to easily flush all of the data. I ran my script to add more events to the DB but now I was getting a duplication error. I tell ya. I looked at my script again and yikes I had some variables inside of my loop. Gah! Why would I even do that? Fixed that up and all was well. I was an event creating pro! Well, it was working anyway and I remembered that I had to also star some events to get them to show up in my template.
I loaded the page and still had the slug error. I tried modifying the parameters but it would still error. i finally just deleted the whole line. Now I had a different error. I deleted that line too. New error. I deleted that line as well and holy shit, events were showing up! Wow! I was pretty excited and happy that I figured it out. Go me!
I told Peter I had it showing events but that I had to delete some of the template. He said that was strange so I showed him the three lines I had to remove. He said those were really important lines. Ugh! Of course they are 🙂 But still, I DID get them to show up in my template so something is working(ish). I’m taking that as a win.
I pushed my changes up to Github so he could look them over when he got a chance and remembered he had sent out an email yesterday saying that he had upgraded Django to 1.6 so I needed to pull in those changes, install the requirements and migrate. Simple! Except not so much. I of course had an error. Something about main_userprofile already existing. I have no idea. I told Peter and he said that was strange. Yes, definitely a theme here. If there is a way to mess something up or break something in a strange way I will most certainly do it. I’d be great in QA!
He had me start a psql session so I could send him some output. Uh, how do I do that again? I managed to figure it out, pasted my output into a gist and then couldn’t for the life of me remember how to exit the session. I typed in all manner of things but not \q because that would be too easy and would also work. Finally did a ctrl-d and that killed it.
Peter looked at my output and asked how it was possible that I had zero migrations. I dunno. He said I should just start over. He said to delete my database and recreate it but he was worried about how much data I would lose. I told him it was no problem at all since I wrote my handy populate_db script so we did that and as I was going through the steps it all became so clear. I had flushed my DB multiple times today but never thought to sync or migrate. Stuff worked anyway. I have no idea how or why……but that would explain my lack of migrations. Once I did that, everything was happy again. For the moment anyway.
My feature branch was pretty out of date with master though so Peter said I needed to do some housekeeping stuff to get everything where it should be. I needed to rebase onto my branch and I also needed to rename my model from StarredEvents to StarredEvent then migrate and then push it all up to Github. That all went just fine. Yay, I don’t think I broke anything! That must mean it’s time for a tea break. Yes. Yes it does.
I asked Wayne to come and get me early before traffic got bad. It is a three day weekend so I imagined it would get pretty backed up. When I got home I got situated on the couch with my tea and got back to work.
I decided to work on the html/css task. I just needed to get a small star icon to display over an image. Ok that was too easy. What I really want is a star that will toggle on and off when I click on it. THAT was turning out to be much more difficult and confusing. I spent the rest of the night reading a bazillion different articles and tutorials using all different methods and ended up much more confused than when I started. Good times.
Today I learned to use [Enter] ~ . to kill a frozen ssh session. Handy!!