Archive for July, 2007

Oil Company Shill DoubleSpeak

Monday, July 30th, 2007

Now, a whale dies while an oil company is doing seismic testing. Coincidence? Maybe, maybe not. But the company shill sure gives a lot of double-talk…

click here to play

Really funny, in a “oh-my-god-that’s-sad-and-pathetic” kind of way. :)

best exchange:

“died of old age”
“how do you know that?”
“it was my understanding it was an elderly whale”
“and how do you know that?”
“well you’re not going to die of old age if you’re young, are you?”

also:

“well i wouldn’t know i’m not a botanist”

!!!

Django Schema Evolution

Thursday, July 19th, 2007

I’ve ported my schema evolution work from my SoC project last summer to Django v0.96.   To use it, download the patch below, and run the following:

$ cd /<path_to_python_dir>/site-packages/django/
$ patch -p1 < ~/<download_dir>/django_schema_evolution-v096patch.txt

It should output the following:

patching file core/management.py
patching file db/backends/mysql/base.py
patching file db/backends/mysql/introspection.py
patching file db/backends/postgresql/base.py
patching file db/backends/postgresql/introspection.py
patching file db/backends/sqlite3/base.py
patching file db/backends/sqlite3/introspection.py
patching file db/models/fields/__init__.py
patching file db/models/options.py

To use it:

$ cd /<path_to_project_dir>/
$ ./manage.py sqlevolve <app_name>

It should output something like this:

BEGIN;
ALTER TABLE `main_query` CHANGE COLUMN `accuracy` `accuracynew` numeric(10, 6) NULL;
ALTER TABLE `main_query` ADD COLUMN `price` varchar(256) NULL;
COMMIT;

Assuming you have a model such as this:

class Query(models.Model):
    query = models.CharField(maxlength=256, blank=False)
    accuracynew = models.FloatField(max_digits=10, decimal_places=6, null=True, blank=True, aka='accuracy')
    price = models.CharField(maxlength=256, null=True, blank=True) # new column

Note the aka field where I changed the name of “accuracy” to “accuracynew”.

Source code:

Documentation:

Let me know if you find any bugs.

Bike Trip 2007

Sunday, July 1st, 2007

Pics: http://picasaweb.google.com/kered.org/BikeTrip2007

pict0112.JPG


<Kered.org>   © Copyright 2000-2005 by Derek Anderson
Get Firefox