Resolving Django dumpdata errors

Recently I recieved this wonderful piece of news when I ran ./manage.py dumpdata for the first time:

Error: Unable to serialize database: User matching query does not exist.

I knew this might not work out since I was dealing with a legacy database, but the resolution is quite simple. First I had to narrow it down to which app was causing this. Naturally I assumed it was one of the two apps I had, either common or restaurant. So I ran: ./manage.py dumpdata common and ./manage.py dumpdata restaurant. The latter had no problem whatsoever.

This made sense, since my common application was the only one that made any reference to a User. By looking in my models.py for that application, I narrowed it down to my Profile object. Sure enough, commenting it out meant I could get my data.

It ended up being a foreign key mismatch between the profile and user tables. Since this is legacy data, this mismatch made sense. A simple SELECT id,userid FROM profile WHERE userid NOT IN (SELECT id FROM auth_user) gave me a list of bad profiles. Removing them allowed me to create my Django fixtures.

Read full post
Snow Leopard for Macports and Mysql users

I use mysql and macports on OSX and both were broken when I upgraded to Snow Leopard.

Read full post
git svn rebase... forever?

While working on addons.mozilla.org I ran into an issue of git svn rebase continually asking me to merge a file, over and over.

Read full post
V is for Version Hell

Read full post
Delicious keeps you in the know

My last task at Delicious was to build along with the amazing Vik Singh was to build a new feed of bookmarks that was heavily influenced by Twitter. It was one of the most interesting and enjoyable pieces of code that I worked on at Delicious.

Read full post
Comprehensive list of international dialing codes

I get bored with mundane tasks. So I create little adventures for myself. I had to create a list of countries and country codes to use on the Firefox mobile home page. The first few lists were incomplete, so I made my own by parsing a list provided by the International Telecommunication Union. I stripped it down to simple forms of the country names and removed codes that are very rare (satellite phones).

Read full post
Removing parental restrictions from the PlayStation 2

Every time I put in a DVD (House, Bones, almost anything) I’d get the parental control screen that I’d have to temporarily unlock. While entering 0000 wasn’t that difficult, it was annoying to have to do this before I could get through all the FBI warnings and to the DVD menu… and finally to my content.

Read full post