'Associate this wrapper with all future mapped columns
of the given type.
This is a convenience method that calls
``associate_with_attribute`` automatically.
.. warning::
The listeners established by this method are *global*
to all mappers, and are *not* garbage collected.   Only use
:meth:`.associate_with` for types that are permanent to an
application, not with ad-hoc types else this will cause unbounded
growth in memory usage.'

@classmethod
def associate_with(cls, sqltype):

    def listen_for_type(mapper, class_):
        for prop in mapper.column_attrs:
            if isinstance(prop.columns[0].type, sqltype):
                cls.associate_with_attribute(getattr(class_, prop.key))
    event.listen(mapper, 'mapper_configured', listen_for_type)
