diff options
| author | Brian Jarrett <celttechie@gmail.com> | 2014-07-20 12:44:40 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-07-20 12:44:40 -0400 |
| commit | cca03097f47f22783d42d1853faac6cf84607c5a (patch) | |
| tree | 4fe1a63d03a2d88d1cf37e1167759dfaf84f4ce7 /lib/sqlalchemy/orm/properties.py | |
| parent | 827329a0cca5351094a1a86b6b2be2b9182f0ae2 (diff) | |
| download | sqlalchemy-cca03097f47f22783d42d1853faac6cf84607c5a.tar.gz | |
- apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,
sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
Diffstat (limited to 'lib/sqlalchemy/orm/properties.py')
| -rw-r--r-- | lib/sqlalchemy/orm/properties.py | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index fabacba05..62ea93fb3 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -39,12 +39,12 @@ class ColumnProperty(StrategizedProperty): Column-based properties can normally be applied to the mapper's ``properties`` dictionary using the :class:`.Column` element directly. - Use this function when the given column is not directly present within the - mapper's selectable; examples include SQL expressions, functions, and - scalar SELECT queries. + Use this function when the given column is not directly present within + the mapper's selectable; examples include SQL expressions, functions, + and scalar SELECT queries. - Columns that aren't present in the mapper's selectable won't be persisted - by the mapper and are effectively "read-only" attributes. + Columns that aren't present in the mapper's selectable won't be + persisted by the mapper and are effectively "read-only" attributes. :param \*cols: list of Column objects to be mapped. @@ -63,8 +63,8 @@ class ColumnProperty(StrategizedProperty): .. versionadded:: 0.6.6 :param comparator_factory: a class which extends - :class:`.ColumnProperty.Comparator` which provides custom SQL clause - generation for comparison operations. + :class:`.ColumnProperty.Comparator` which provides custom SQL + clause generation for comparison operations. :param group: a group name for this property when marked as deferred. @@ -111,12 +111,12 @@ class ColumnProperty(StrategizedProperty): """ self._orig_columns = [expression._labeled(c) for c in columns] self.columns = [expression._labeled(_orm_full_deannotate(c)) - for c in columns] + for c in columns] self.group = kwargs.pop('group', None) self.deferred = kwargs.pop('deferred', False) self.instrument = kwargs.pop('_instrument', True) self.comparator_factory = kwargs.pop('comparator_factory', - self.__class__.Comparator) + self.__class__.Comparator) self.descriptor = kwargs.pop('descriptor', None) self.extension = kwargs.pop('extension', None) self.active_history = kwargs.pop('active_history', False) @@ -145,9 +145,9 @@ class ColumnProperty(StrategizedProperty): util.set_creation_order(self) self.strategy_class = self._strategy_lookup( - ("deferred", self.deferred), - ("instrument", self.instrument) - ) + ("deferred", self.deferred), + ("instrument", self.instrument) + ) @property def expression(self): @@ -166,7 +166,7 @@ class ColumnProperty(StrategizedProperty): comparator=self.comparator_factory(self, mapper), parententity=mapper, doc=self.doc - ) + ) def do_init(self): super(ColumnProperty, self).do_init() @@ -181,18 +181,18 @@ class ColumnProperty(StrategizedProperty): def copy(self): return ColumnProperty( - deferred=self.deferred, - group=self.group, - active_history=self.active_history, - *self.columns) + deferred=self.deferred, + group=self.group, + active_history=self.active_history, + *self.columns) def _getcommitted(self, state, dict_, column, - passive=attributes.PASSIVE_OFF): + passive=attributes.PASSIVE_OFF): return state.get_impl(self.key).\ - get_committed_value(state, dict_, passive=passive) + get_committed_value(state, dict_, passive=passive) def merge(self, session, source_state, source_dict, dest_state, - dest_dict, load, _recursive): + dest_dict, load, _recursive): if not self.instrument: return elif self.key in source_dict: @@ -257,4 +257,3 @@ class ColumnProperty(StrategizedProperty): def __str__(self): return str(self.parent.class_.__name__) + "." + self.key - |
