Brad's Blog

web dev, django, running, food, or whatever

A simple Django example with Ajax 2008-11-24

I often employ Ajax in HTML forms in order to update the list of options in select elements. For example, suppose a form consists of two select elements, and the options in the second depends on the values selected in the first. A simple example of this might be an Automobile Rental website that lets you choose the type of vehicle as well as the color. Not all vehicles come in the same color, though, so you might have a ...

Extending Django's MultiWidget: SplitSelectDateTimeWidget 2008-11-19

This entry is an update to SelectTimeWidget: A custom Django Widget. The Problem: I want to use a Single widget object for a DateTimeField, but I want it to consist of select elements with appropriate options for month, day, year, hour, minute, and second. Additionally, I want to be able to specify a 12-hour format, so I would then need options for "a.m." and "p.m."Fortunately, Django's SelectDateWidget (from django.forms.extras.widgets) takes care of the Date portion of this, and I've previously ...

SelectTimeWidget: A custom Django Widget 2008-11-18

I've been meaning to write this blog post for quite some time...Django Models provide a way to create a definitive source of data for web applications. Written as a python class, a Django Model consists of Fields that (among other things) define a type for your data. Django's Forms provide a mechanism for generating HTML form elements and validating user input. A sublcass of Django's Form class is the ModelForm which essentially creates a Form based on the Fields in ...

Soup's On! And it IS Beautiful! 2008-11-17

Here's the problem: There's a BAJILLIION static html pages sitting out on a server, and I need to migrate all that content to a new Database-driven CMS. Additionally, I need to get rid of a lot of non-essential hard-coded presentational markup (like align="center" or font="whatever") and any inline styles that may exist... (you know, because external CSS is the way to go).I could spend hours and hours just copy-/pasting stuff... but meh. Enter BeautifulSoup, urllib, and sqlite... all glued together ...

Wordle - Cool Word Clouds 2008-11-12

I've just run across Wordle, a nifty app that generates artistic word clouds based on text you give it. It also consumes rss or atom feeds, so you can do something like the image below:It's quite interesting what sort of things stand out in this... I just happened to notice that everyone want great web!

BarCampMemphis, the Day After 2008-11-09

I think everyone is in agreement: BarCampMemphis was a tremendous success! I want to personally thank everyone who came to my Zero-to-Wiki in 30 minutes with Django session, and I also want to remind everyone that the Presentation and the code is freely available!There were many great sessions available throughout the day, but I want to list the ones I got to attend... all of which were just excellent:Dave Barger's LinkedIn tipsWill Murphy's insights on what's changing on the webScott ...

A topic for BarCampMemphis 2008-10-22

I've recently watched the What is BarCamp video, and I've been thinking about a Django-related topic. I'm sure there are plenty of web developers out there looking for a better way...Now, I've only been using Django for about 5 months, but I'm pretty sure I could give any interested kindred souls a good jump-start. And so that's what I'd like to do... show by example.The Example? Why not a wiki... It's simple. (blog examples have been overdone)So there it is... ...

on beards 2008-10-05

I just ran across an interesting beard video on vimeo. Lots of cool links including, the World Beard and Moustache Championships, and the BLF. Fun stuff.

hack your iphone earbuds... 2008-09-23

I've been complaining (inwardly) about my iPhone's earbuds since I first tried them on. Who knew it was so easy to just hack them!iPhone / iPod Touch Headphone / Earbud Replacement

iTunes Genius Lies! 2008-09-16

I begrudgingly turned on the Genius Sidebar in iTunes 8 and now it's showing me the "Top Songs You're Missing"... except, I'm not missing them! Surely Apple doesn't think I should purchase music that's already in my library! Maybe this is just a bug... or maybe iTunes is confuzed because my album is "Weezer (Blue Album)"... who knows.