MacPorts Python 2.6 + Snow Leopard

I just thought I’d provide a friendly heads up to the Django and Pythoncommunities that the Python 2.6 distributed with MacPorts does not compile on Snow Leopard as of now. This issue is outlined on MacPorts ticket #20284.

There are some really hacky work-arounds, but they are not for the feint of heart. This is reportedly an upstream Python problem, and has been reported as such by the MacPorts community. While Python 2.6 is included with Snow Leopard, MacPython requires its own Python26 package for many other things.

Other than that, Snow Leopard has been great. This is not a complete show-stopper since you can just manually install stuff, but it is somewhat annoying.

Django + EVE Online

For the use of fellow Djangonauts out there, I introspected and fixed upCCP’s SQL dump of EVE Online data. This means you can now get access to everything from the comforts of the Django ORM.

The project is still very new, and I’m not even sure it’s going to be attractive given the table layout. At this point, it is a bunch of introspected models and a fixed up database dump. I’ll be adding convenience methods, __unicode__ functions, and etc with time to make it more friendly. Check it out at:

http://code.google.com/p/django-eve/

For now this will only work on Postgres until some kind soul wants to get the MySQL or SQLite dumps fixed up (some tables need ‘id’ primary keys).

Browser Games with Django (English)

Just looking through DjangoSites.org and Googling around, I’mabsolutely puzzled by the lack of Django-based browser games. It is such an idea platform for developing these, yet there are only a few that are actually open to the public (some of which aren’t in English, and are thus inaccessible to me). There seem to be a few games out there in French, Chinese, and some other things I don’t really recognize, though.

Here are a few games in English I’ve been able to round up:

I’m particularly interested in anything open-source, as I’d love to contribute from time to time, but I’d love to hear of any playable games that I have missed, or any open-source games in development. As far as close-sourced games in development, they’re not of much interest to me if they’re at least not open for testing. Without access to the source or a reachable site, it’s as good as vaporware (and many of them never see completion).

So speak up, let me know if there’s something that I’ve completely missed!

Multi-Model Inheritance + Fixtures = Fixed

I just thought I’d take a moment to give everyone a heads up thatMulti-Model Inheritance fixture dumping and loading is now fixed, as per Russ Magee’s changeset 7600. This fixes a subtle problem that some of you may have seen in the form of foreign keys pointing to the wrong objects after using loaddata to restore an app.

The “pk” fields (usually ‘id’) in the serialized dump weren’t being loaded correctly, meaning that the objects id fields defaulted to the table’s incremental numbering rather than using the number specified in your object’s fixture’s “pk” field. This would not be an issue unless you deleted an object in your original table and thus had a gap in your primary keys (IE: they were no longer un-interrupted and sequential).

Let’s say you have three objects, 1 (Apple), 2 (Banana), 3 (Orange). You delete Banana (2) and now have entries with keys of 1 and 3 (non-sequential). Some other arbitrary models point at 1 and 3, and you now dumpdata your Fruit app and re-load it. The loader ignores the fact that Orange’s PK is 3 and instead just adds it right behind apple as PK 2 (sequential, the default behavior for primary keys when no value is specified). All of your other relations pointing at Orange in other tables are now broken, and you’re likely to see Exceptions thrown or models pointing to the wrong fruit (if you had more fruit defined to be compacted into PK 3).

I have a feeling I didn’t explain this well. In the event that you’d like further elaboration, see the Django-Users post where it’s outlined a little beter. For those using Multi-Model inheritance and fixtures, this was a definite show-stopper.

A big thinks goes out to Russ Magee for fixing this!