Hey
How can I follow the foreign key relation by related_name by using
select_related()?

ex:

Class Strings(models.Model):
    string = CharField(max_length=255)

Class Stuff(models.Model):
    spam = models.ForeignKey(Strings, db_column='spam',
related_name='spam', db_index=True, blank=True)
    eggs = models.ForeignKey(Strings, db_column='eggs',
related_name='eggs', db_index=True, blank=True)

I what to make a query that looks something like this:
Suff.objects.all().select_related().order_by('<the string field in the
table Strings referenced by the field spam in Stuff>')

thanks for the help

Stephane
--~--~---------~--~----~------------~-------~--~----~
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