diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/assignmapper.py | 2 | ||||
-rw-r--r-- | test/ext/activemapper.py | 2 |
3 files changed, 5 insertions, 1 deletions
@@ -9,6 +9,8 @@ activated when activemapper is imported - fixes to Session expunge/update/etc. - select_table mappers *still* werent always compiling - fixed up Boolean datatype +- added count()/count_by() to list of methods proxied by assignmapper; +this also adds them to activemapper 0.2.5 - fixed endless loop bug in select_by(), if the traversal hit diff --git a/lib/sqlalchemy/ext/assignmapper.py b/lib/sqlalchemy/ext/assignmapper.py index 29cc70b3e..240a46e3b 100644 --- a/lib/sqlalchemy/ext/assignmapper.py +++ b/lib/sqlalchemy/ext/assignmapper.py @@ -31,7 +31,7 @@ def assign_mapper(ctx, class_, *args, **kwargs): extension = ctx.mapper_extension m = mapper(class_, extension=extension, *args, **kwargs) class_.mapper = m - for name in ['get', 'select', 'select_by', 'selectone', 'get_by', 'join_to', 'join_via']: + for name in ['get', 'select', 'select_by', 'selectone', 'get_by', 'join_to', 'join_via', 'count', 'count_by']: monkeypatch_query_method(ctx, class_, name) for name in ['flush', 'delete', 'expire', 'refresh', 'expunge', 'merge', 'save', 'update', 'save_or_update']: monkeypatch_objectstore_method(ctx, class_, name) diff --git a/test/ext/activemapper.py b/test/ext/activemapper.py index 85466e29b..1ff8b0d7b 100644 --- a/test/ext/activemapper.py +++ b/test/ext/activemapper.py @@ -218,6 +218,8 @@ class testcase(testbase.PersistTest): ) self.assertEquals(len(results), 1) + self.assertEquals(Person.count(), 2) + class testselfreferential(testbase.PersistTest): def setUpAll(self): global TreeNode |