Hello,

I am using QuerySet "extra()" function. For the "tables" parameter I
need to specify the same table multiple times, so I included an alias
for each table. Unfortunately Django quotes the table names and
everything is messed up.

The "tables" parameter for the "extra()" is:

  tables ['FName F0', 'FName_Person Fp0', 'FName F1', 'FName_Person Fp1']

Here is how the generated query looks like:

  SELECT COUNT(DISTINCT `Person`.`id`)
  FROM
    `Person` ,
    `FName F0` ,
    `FName_Person Fp0` ,
    `FName F1` , 
    `FName_Person Fp1` 
  WHERE ...

If I remove the alias, Django does not realize that I give the same
table multiple times and does not generate any aliases.

I really need the same table multiple times.

Is there a way around this?

An easy fix might be to ask Django not to quote the "tables"
parameter. Is there a easy way to do this?

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to