From 20fa7fe2b85d356e3da08191f01d7528ded42033 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 16 Aug 2012 22:20:53 -0400 Subject: - modernize most of the postgis example. would like to do [ticket:1534] also. - we don't have coverage for type-wide instrumentation events, the listener was broke. could break again too. --- lib/sqlalchemy/orm/events.py | 6 ++++-- lib/sqlalchemy/schema.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/events.py b/lib/sqlalchemy/orm/events.py index 05f640ab0..25211d146 100644 --- a/lib/sqlalchemy/orm/events.py +++ b/lib/sqlalchemy/orm/events.py @@ -25,8 +25,9 @@ class InstrumentationEvents(event.Events): @classmethod def _accept_with(cls, target): + # TODO: there's no coverage for this if isinstance(target, type): - return orm.instrumentation.instrumentation_registry + return orm.instrumentation._instrumentation_factory else: return None @@ -36,7 +37,8 @@ class InstrumentationEvents(event.Events): @classmethod def _remove(cls, identifier, target, fn): - raise NotImplementedError("Removal of instrumentation events not yet implemented") + raise NotImplementedError("Removal of instrumentation events " + "not yet implemented") def class_instrument(self, cls): """Called after the given class is instrumented. diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index e79e12f7b..f2ca45894 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -408,6 +408,11 @@ class Table(SchemaItem, expression.TableClause): self, include_columns, exclude_columns ) + @util.memoized_property + def info(self): + """Dictionary provided for storage of additional information.""" + return {} + @property def _sorted_constraints(self): """Return the set of constraints as a list, sorted by creation order.""" @@ -965,6 +970,11 @@ class Column(SchemaItem, expression.ColumnClause): else: return self.description + @util.memoized_property + def info(self): + """Dictionary provided for storage of additional information.""" + return {} + def references(self, column): """Return True if this Column references the given column via foreign key.""" -- cgit v1.2.1