Ok.  Dropping down to raw sql query gets me my results, however the
tuple returned doesn't work with my datagrid widget.  Is there any way
to coerce the tuple to a sqlobject.sresults.SelectResult object?  Or
to run the raw query so that it returns the SelectResults object?

files = model.Files._connection.queryAll("""SELECT files.* FROM files
INNER JOIN (SELECT MAX(id) AS id FROM files GROUP BY filename) ids ON
files.id = ids.id""")

~~~~~~~~~~~~~~~~~
Page handler: <bound method Root.index of <audiotic.controllers.Root
object at 0x1b3f990>>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/CherryPy-2.3.0-py2.4.egg/cherrypy/
_cphttptools.py", line 121, in _run
    self.main()
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/CherryPy-2.3.0-py2.4.egg/cherrypy/
_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
controllers.py", line 357, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
database.py", line 358, in so_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
controllers.py", line 372, in <lambda>
    mapping, fragment, args, kw)))
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
controllers.py", line 401, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
errorhandling.py", line 77, in try_call
    return func(self, *args, **kw)
  File "<string>", line 3, in index
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
paginate.py", line 203, in decorated
    var_data = sort_data(var_data, ordering)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
paginate.py", line 537, in sort_data
    data.sort(key=key, reverse=reverse)
  File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/TurboGears-1.0.5-py2.4.egg/turbogears/
paginate.py", line 47, in __call__
    obj = getattr(obj, name)
AttributeError: 'tuple' object has no attribute 'date'


On Dec 20, 3:30 am, "Diez B. Roggisch" <[email protected]> wrote:
> Sean DiZazzo schrieb:
>
> > Can someone give me a pointer on this?  I tried using INNERJOIN, etc
> > to no avail.
>
> > Need to give myself a course in MySQL joins
>
> You should carry this to the SQLObject mailing list.
>
> And you should *show* what you tried & why it failed for you.
>
> Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to