Blog Archive for May 4, 2010

Postgres Years Between

May 4, 2010

I wanted to do a SQL query which would show the earliest and latest dates for something, and show the number of years between them. This was to clean some data that linked people to events - if we had the same person taking part in events in both 1901 …

Django Blog Comment Count

May 4, 2010

If I have a Blog model object in Django, and it has many Comment objects, then what's the most efficient way of getting hold of the comment count alongside a list of blog entries? I was thinking I'd have to fall back on raw SQL, but there's an easier way. …

Tags: django orm sql

417 Expectation Failed Cast Iron

May 4, 2010

We're migrating lots of users from Cast Iron 3.6.2.5 to Cast Iron 4.0.5.1. We're having lots of trouble with the Expect header.

417 Expectation Failed

The expectation given in the Expect request-header
field could not be met by this server.
The client sent
    Expect: 100-continue

but we only allow the …