def __init__(self, *columns, **kwargs): """The list of `columns` describes a single object property. If there are multiple tables joined together for the mapper, this list represents the equivalent column as it appears across each table. """ self.columns = [expression._labeled(c) for c in columns] self.group = kwargs.pop("group", None) self.deferred = kwargs.pop("deferred", False) self.comparator_factory = kwargs.pop("comparator_factory", self.__class__.Comparator) self.extension = kwargs.pop("extension", None) util.set_creation_order(self) if self.deferred: self.strategy_class = strategies.DeferredColumnLoader else: self.strategy_class = strategies.ColumnLoader
def __init__(self, *columns, **kwargs): """The list of `columns` describes a single object property. If there are multiple tables joined together for the mapper, this list represents the equivalent column as it appears across each table. """ self.columns = [expression._labeled(c) for c in columns] self.group = kwargs.pop('group', None) self.deferred = kwargs.pop('deferred', False) self.comparator_factory = kwargs.pop('comparator_factory', self.__class__.Comparator) self.extension = kwargs.pop('extension', None) util.set_creation_order(self) if self.deferred: self.strategy_class = strategies.DeferredColumnLoader else: self.strategy_class = strategies.ColumnLoader
def __init__(self, *columns, **kwargs): """Construct a ColumnProperty. :param \*columns: The list of `columns` describes a single object property. If there are multiple tables joined together for the mapper, this list represents the equivalent column as it appears across each table. :param group: :param deferred: :param comparator_factory: :param descriptor: :param extension: """ self.columns = [expression._labeled(c) for c in columns] self.group = kwargs.pop('group', None) self.deferred = kwargs.pop('deferred', False) self.no_instrument = kwargs.pop('_no_instrument', False) self.comparator_factory = kwargs.pop('comparator_factory', self.__class__.Comparator) self.descriptor = kwargs.pop('descriptor', None) self.extension = kwargs.pop('extension', None) if kwargs: raise TypeError( "%s received unexpected keyword argument(s): %s" % ( self.__class__.__name__, ', '.join(sorted(kwargs.keys())))) util.set_creation_order(self) if self.no_instrument: self.strategy_class = strategies.UninstrumentedColumnLoader elif self.deferred: self.strategy_class = strategies.DeferredColumnLoader else: self.strategy_class = strategies.ColumnLoader