Having gone on a dot-removal frenzy, I still have this one that fails :
>>> from camps import models
>>> app_list =
models.Application.objects.select_related().order_by('camps_board_time_block
.start_time')
>>> app_list
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/models/que
ry.py", line 97, in __repr__
    return repr(self._get_data())
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/models/que
ry.py", line 430, in _get_data
    self._result_cache = list(self.iterator())
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/models/que
ry.py", line 172, in iterator
    cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") +
",".join(select) + sql, params)
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/backends/u
til.py", line 12, in execute
    return self.cursor.execute(sql, params)
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/db/backends/m
ysql/base.py", line 35, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in
execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33,
in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'camps_board_time_block.start_time'
in 'order clause'")

I've tried substituting fields of other related tables, and they work fine.

Going directly into the db, I think I have everything spelled correctly :
mysql> describe camps_board_time_block;
+------------+---------+------+-----+---------+----------------+
| Field      | Type    | Null | Key | Default | Extra          |
+------------+---------+------+-----+---------+----------------+
| id         | int(11) | NO   | PRI | NULL    | auto_increment | 
| board_id   | int(11) | NO   | MUL |         |                | 
| start_time | time    | NO   |     |         |                | 
| end_time   | time    | NO   |     |         |                | 
| _order     | int(11) | YES  |     | NULL    |                | 
+------------+---------+------+-----+---------+----------------+

Is there a way to get at the actual SQL that's being executed ?

Chris




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