How to translate this SQL (nearest 20) into Django?

2007-06-25 Thread Tim Tsai
Given the corresponding query and output, what would be the best way to translate that into Django? I've looked at QuerySet, filter, etc. but can't quite figure out the best way to do this. The idea is to find the nearest 20 rows that matches, of course. The 2 will be passed via URL (i.e

dilling down with generic views

2007-04-04 Thread Tim Tsai
I am learning Django and my first program is a drill-down type page similar to what I see at http://chicagocrime.org. I am using generic views and have run into confusion about how to handle a URL like this: http://www.chicagocrime.org/types/armed_violence/245/ I have two models, programs