Hi,
i have a model which is inherited from another model. I use
SQLObject.
The subclass contains a DateTimeCol, which should be ordered
descending during select. The name of the column is 'created'. I've
done it with
list = Post.select(orderBy=DESC(MyModel.q.created))
This does not work. So I've tried an alternative:
list = Post.selecr(orderBy=MyModel.q.created).reversed()
which works. Silly.
So what's the problem with DESC()? It seems that the cause is the
inheritance, the stack trace points to that (just the last few lines
for bette readability):
File "c:\python25\lib\site-packages\SQLObject-0.9.1-py2.5.egg
\sqlobject\sresults.py", line 173, in lazyIter
return conn.iterSelect(self)
File "c:\python25\lib\site-packages\SQLObject-0.9.1-py2.5.egg
\sqlobject\dbconnection.py", line 400, in iterSelect
select, keepConnection=False)
File "c:\python25\lib\site-packages\SQLObject-0.9.1-py2.5.egg
\sqlobject\inheritance\iteration.py", line 10, in __init__
super(InheritableIteration, self).__init__(dbconn, rawconn,
select, keepConnection)
File "c:\python25\lib\site-packages\SQLObject-0.9.1-py2.5.egg
\sqlobject\dbconnection.py", line 788, in __init__
self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
File "c:\python25\lib\site-packages\SQLObject-0.9.1-py2.5.egg
\sqlobject\sqlite\sqliteconnection.py", line 183, in _executeRetry
raise OperationalError(ErrorMessage(e))
OperationalError: no such column: post.created
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---