diff --git a/VERSION b/VERSION index d38c6b08..3fd1bc7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-25 23:54:19) dev +Version 2.00.0 (2012-08-26 00:00:11) dev diff --git a/gluon/dal.py b/gluon/dal.py index f11f22d7..f2e7e368 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -8886,13 +8886,13 @@ class Rows(object): row.append(none_exception(value)) writer.writerow(row) - def xml(self,strict=False): + def xml(self,strict=False,row_name='row',rows_name='rows'): """ serializes the table using sqlhtml.SQLTABLE (if present) """ if strict: ncols = len(self.colnames) - def f(row,field='row',indent=' '): + def f(row,field,indent=' '): if isinstance(row,dict): spc = indent+' \n' items = [f(row[x],x,indent+' ') for x in row] @@ -8906,7 +8906,10 @@ class Rows(object): return '%s<%s>%s' % (indent,field,row,field) else: return None - return '\n%s\n' % '\n'.join(f(row) for row in self) + return '<%s>\n%s\n' % ( + rows_name, + '\n'.join(f(row,row_name) for row in self), + rows_name) import sqlhtml return sqlhtml.SQLTABLE(self).xml()