Hi Massimo,
There are typos. See the following patch, especially the last two
modifications.
(By the way, I am not sure about my first modified line, i.e.
"self.environment = current # for backward compatibility". Some of my
legacy apps uses a sub-classed Crud, which referencing the
self.environment. Yet defining "self.environment = current" seems not
enough because there is still more error tickets. I need to dig deeper
to see what's going on.
Regards,
Iceberg
diff -r 031e5882c71a gluon/tools.py
--- a/gluon/tools.py Fri May 06 21:32:30 2011 -0500
+++ b/gluon/tools.py Sat May 07 20:35:36 2011 +0800
@@ -2666,6 +2666,7 @@
self.db = environment
elif not db:
raise SyntaxError, "must pass db as first or second
argument"
+ self.environment = current # for backward compatibility
self.settings = Settings()
self.settings.auth = None
self.settings.logger = None
@@ -3056,12 +3057,12 @@
headers={},
**attr
):
- rows = self.rows(table,query,fields,orderby,orderby,limitby)
+ rows = self.rows(table,query,fields,orderby,limitby)
if not rows:
return None # Nicer than an empty table.
if not 'upload' in attr:
attr['upload'] = self.url('download')
- if not request.extension in ('html','load'):
+ if not current.request.extension in ('html','load'):
return rows.as_list()
if not headers:
headers = dict((str(k),k.label) for k in table)