From f104bf1d9c1e0a4517eb8f0253a648b9de134787 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Thu, 5 Apr 2012 18:08:22 -0500 Subject: [PATCH] auth.enable_record_versioning(...db=...) --- VERSION | 2 +- gluon/tools.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 9c0abb0c..41d92311 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-04-05 18:03:27) dev +Version 1.99.7 (2012-04-05 18:08:16) dev diff --git a/gluon/tools.py b/gluon/tools.py index e7548aaf..3b8fad04 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -1259,6 +1259,7 @@ class Auth(object): def enable_record_versioning(self, tables, + db = None, archive_names='%s_archive', current_record='current_record'): """ @@ -1296,12 +1297,13 @@ class Auth(object): fields[current_record] = row.id archive_table.insert(**fields) + archive_db = db or self.db tables = [table for table in tables] for table in tables: fieldnames = table.fields() if 'modified_by' in fieldnames and 'modified_on' in fieldnames: archive_name = archive_names % table._tablename - archive_table = self.db.define_table( + archive_table = archive_db.define_table( archive_name, Field(current_record,table), table)