Merge branch 'master' of github.com:web2py/web2py

This commit is contained in:
mdipierro committed 2014-02-19 08:51:03 -06:00
commit a359afb799
1 file changed
+3
+3
View File
@@ -8158,7 +8158,10 @@ def index():
otable = table otable = table
i += 1 i += 1
if i == len(tags) and table: if i == len(tags) and table:
if hasattr(db[table], '_id'):
ofields = vars.get('order', db[table]._id.name).split('|') ofields = vars.get('order', db[table]._id.name).split('|')
else:
ofields = vars.get('order', db[table]._primarykey[0]).split('|')
try: try:
orderby = [db[table][f] if not f.startswith('~') else ~db[table][f[1:]] for f in ofields] orderby = [db[table][f] if not f.startswith('~') else ~db[table][f[1:]] for f in ofields]
except (KeyError, AttributeError): except (KeyError, AttributeError):