#2210: [patch] order_by on related table with db_column different to name fails
------------------------------------------------+---------------------------
Reporter: Russell Cloran <[EMAIL PROTECTED]> | Owner:
adrian
Status: new | Component:
Database wrapper
Version: SVN | Resolution:
Keywords: order_by related | Stage:
Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 1 | Needs_better_patch: 0
------------------------------------------------+---------------------------
Comment (by [EMAIL PROTECTED]):
I just found out exactly the same error happens in this case:
{{{
from django.db import models
class Book(models.Model):
title = models.TextField()
class BookStat(models.Model):
book = models.OneToOneField(Book)
times_read = models.PositiveIntegerField()
Book.objects.all().order_by("bookstat__times_read")
}}}
I.e. can't sort by a one-to-one field in another model.
- bram
--
Ticket URL: <http://code.djangoproject.com/ticket/2210#comment:12>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---