Hi,

I have the following relation:

class Email(models.Model):
    id = models.CharField(max_length=15,primary_key=True)

...

class Person(models.Model):
    id= models.CharField(max_length=15,primary_key=True)
    email = models.ForeignKey(Email, db_column='id')


When I do: Person.objects.select_related().all()
The query that is run is:

SELECT id,email FROM Person INNER JOIN Email ON (Person.id =
Email.id)

As you can see if a person did not have an email address, this will
produce an empty list. Is there any way to force select_related to do
a LEFT JOIN so that even if email is null, the person is returned with
email set to null.

Cheers,
Thusjanthan.







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

Reply via email to