Malcom... thanks for all the info :)
I didn't paste all of my model code into the sample... each of those
tables actually has Foreign Keys to a few other things..which also
contains foreign keys...
The page that was slowing down was a page where I basically had a drop
down showing Companies (
On Sat, 2007-03-10 at 03:03 +, [EMAIL PROTECTED] wrote:
> Is there a way to load a related object by still using .values()?
[... example snipped ...]
> And for company I only want to
> load .values('company_name','company_id') , but for each company in
> the result set...I want to be able to
Ok...if there is a better way to do this...please let me know..but
since I couldn't figure out how to get the office_set populated...I
just did this:
all_companies =
Company.objects.all().order_by('company_name').distinct()#.values('company_id','company_name')
#offices for the com
Is there a way to load a related object by still using .values()?
For example I have:
class Company(models.Model):
company_id = models.AutoField(primary_key=True)
parent_company = models.ForeignKey("self",null=True)
address =
models.ForeignKey('Address',related_name="company_address"
Coffee hasn't kicked in yet...I figured it out about 5 minutes after
asking... and was about to post back the same thing! Thanks!
On Mar 9, 9:47 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2007-03-09 at 14:39 +, [EMAIL PROTECTED] wrote:
> > Pehraps I'm doing something wrong h
On Fri, 2007-03-09 at 14:39 +, [EMAIL PROTECTED] wrote:
> Pehraps I'm doing something wrong here. I should mention I am using
> the multiple-database branch, so perhaps it's a bug...but thought I'd
> check if my syntax is correct.
>
> I'm trying to trim down the data returned from a query to
Pehraps I'm doing something wrong here. I should mention I am using
the multiple-database branch, so perhaps it's a bug...but thought I'd
check if my syntax is correct.
I'm trying to trim down the data returned from a query to speed things
up, as I only need three fields for this particular piec
7 matches
Mail list logo