Wednesday, June 13, 2007

Getting it right

Coming into training, I had worked in Django for about 8 months or so, and therefore had a relatively good idea of how things worked. However, I never really learned Django the right way, having mostly worked off of just reverse engineering other people's code, figuring out what does what, and then building something new based off of those methods. Going through each step and actually taking the time to do it the right way has definitely helped me solidify many concepts in Django so that I can program more efficiently, without having to fall back on previously developed code segments.
Beyond that, I had never looked at the newforms library before, so everything we've done with that has been an interesting learning experience. It makes me wonder what other basic web development functions can be simplified to such an efficient degree as they've done for forms.

Django or Rails?

This class actually makes that decision hard. Django is obviously well thought out; I know python a lot better than Ruby; Never really looked at django untill I needed to for my job. Now that I have and with the very good instructions of Juan Django is becoming very attractive. (What made Rails very attractive is the amount of books on it one can find in any given bookstore.) I have picked a project coming up for my first django app! Following the class with that project in mind.

On the class: Highly recommended. the instruction book itself is very well written as a long tutorial. (There is a disadvantage to this however: When I skipped the exercises for one chapter and went to the next it turned out that I needed the result of those exercises for the next chapter!). Juan is extremely knowledgeable I am learning more in a week than I would have in a month of self study. Also since one of the main drawbacks of django is the lack of third party documentation a class such as this is highly recommended.

Tuesday, June 12, 2007

What a day

It's the end of the second day and we covered a lot of ground -- admin, views, templates and newforms.

The biggest knowledge gain for me was newforms -- they're very nice. I'm no slouch when it comes to HTML, but this is one task I'm glad Django automates for me. I've spent enough time debugging/writing code to handle form input/form generation -- this is really one area where I think Django shines above Rails (not that they're competing against each other... they're just the two "next gen" frameworks I've tried).

One thing that did bug me is that there must be a better way to remove the "------" choice from a Django ForeignKey <select> representation than my way:

good_choices = []
for choice in Form.base_fields['todo_list'].widget.choices:
if choice[0]:
#Cuz if it's false, it's probably the stupid -------- choice
good_choices.append(choice)

Form.base_fields['todo_list'].widget.choices = good_choices


Tomorrow is Forms Part II....

First Day Completed

Finding Juan Pablo's explanations clear and concise. Very stressless and informative first day. Being somewhat new to django and having hacked away at some apps, it was good to have the documentation and Juan Pablo's intro into how and why things work the way they do. Looking forward to delving into some deeper django concepts and usages. Think it was a great start.

Monday, June 11, 2007

So far, so good

It's still the middle of our first day of training, but it's going well.

Our instructor, Juan Pablo-Claude, did a good rundown of what Django is -- probably could use a bit of background on its history, but maybe later as we get into specific design decisions the core team made.

Our first day, so far, has been setup and install of Python, the DB drivers, Django, etc. Personally, I've realized how quasi-painful that can be (esp. when I sat down with our summer intern to do this the other day) -- I'm thinking it'd be cool I could build a Parallels image (maybe VM?) of something like Ubuntu/CentOS that has everything you need and the ability to mount it onto your Mac as a filesystem, so you can use your favorite Mac text editor (Textmate, presently).

Also, Juan's done a good job of pulling together some Python basics for folks new to Django (and thus Python) -- though I may be biased as I've got about 4+ years of Python experience...