#2076: order_by with related table does not work
---------------------------+------------------------------------------------
   Reporter:  mtredinnick  |                Owner:  mtredinnick     
     Status:  new          |            Component:  Database wrapper
    Version:  SVN          |           Resolution:                  
   Keywords:               |                Stage:  Accepted        
  Has_patch:  1            |           Needs_docs:  0               
Needs_tests:  0            |   Needs_better_patch:  1               
---------------------------+------------------------------------------------
Comment (by Michael Radziej <[EMAIL PROTECTED]>):

 With postgresql, test 'reserved_names' also fails. There's a strange line
 in it:
 
 {{{
 >>> Thing.objects.order_by('select.when')
 }}}
 
 The model is:
 
 {{{
 class Thing(models.Model):
     when = models.CharField(maxlength=1, primary_key=True)
     join = models.CharField(maxlength=1)
     like = models.CharField(maxlength=1)
     drop = models.CharField(maxlength=1)
     alter = models.CharField(maxlength=1)
     having = models.CharField(maxlength=1)
     where = models.DateField(maxlength=1)
     has_hyphen = models.CharField(maxlength=1, db_column='has-hyphen')
 
     class Meta:
        db_table = 'select'
 }}}
 
 So, {{{select.when}}} does not make sense, but it used to work since the
 database table was called 'select'. IMHO, this is not a valid use. But the
 test case needs to be removed and the minor incompatibility should be
 noted.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2076#comment:29>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to