Re: select_related() - how to get multiple depth joins

2007-03-17 Thread bmeredyk
Excellent!! - req.country.subregion.subregion_name works like a charm - thank you so much! I figured it was probably just me not understanding the correct way to ask django for the info. I'm so used to php and raw sql that there's a bit of a learning curve. On Mar 17, 11:36 pm, "RajeshD" <[EMAI

select_related() - how to get multiple depth joins

2007-03-17 Thread bmeredyk
So I'm new to Django and I'm having a hard time with the dbi syntax or something. I'm trying to figure out how exactly the select_related() method works - My understanding is that by using select_related, django will go ahead and follow foreign keys as far as it can. Unfortunately, I'm not actual

Newbie - How do I perform custom sql queries?

2006-09-17 Thread bmeredyk
I'm just starting out with django and need some help with how to perform custom queries. The query I want to do is basically this: SELECT num_volunteers, num_boxes, (num_boxes * 216) as meals, (num_boxes/num_volunteers) as box_per_person FROM shifts WHERE site = %s AND date BETWEEN %s and %s I'