]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
merge latest tip
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 3 Sep 2010 22:01:59 +0000 (18:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 3 Sep 2010 22:01:59 +0000 (18:01 -0400)
1  2 
doc/build/mappers.rst
lib/sqlalchemy/ext/declarative.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
test/orm/test_mapper.py

index 9ae73861afbe31307042d1e600e0cc0d453cb07b,b7409647bfb5fac77e8871fef0fe36f929453027..bcb35e81392ed92d25db8cab6d59a84f9d8fc3d1
@@@ -318,17 -361,24 +375,23 @@@ The ``email`` attribute is now usable i
  other mapped attribute, including filter expressions,
  get/set operations, etc.::
  
 -    address = session.query(EmailAddress).filter(EmailAddress.email == 'some address').one()
 +    address = session.query(EmailAddress).\\
 +                filter(EmailAddress.email == 'some address').\\
 +                one()
  
      address.email = 'some other address'
 -    session.flush()
 -
 -    q = session.query(EmailAddress).filter_by(email='some other address')
 +    session.commit()
  
 -If the mapped class does not provide a property, the :func:`.synonym` construct will create a default getter/setter object automatically.
 +    q = session.query(EmailAddress).\
 +                filter_by(email='some other address')
  
 -To use synonyms with :mod:`~sqlalchemy.ext.declarative`, see the section 
 -:ref:`declarative_synonyms`.
  
+ Note that the "synonym" feature is eventually to be replaced by the superior
+ "hybrid attributes" approach, slated to become a built in feature of SQLAlchemy
+ in a future release.  "hybrid" attributes are simply Python properties that evaulate
+ at both the class level and at the instance level.  For an example of their usage,
+ see the :mod:`derived_attributes` example.
  .. _custom_comparators:
  
  Custom Comparators
Simple merge
index 7a92e8946fe60b9a2ab2563134890c9ca303dabe,f03dd6377223b4caffed8163e59626db4d0f7583..3374ea72d2aa69e36fd00f0f476205a59bd63239
@@@ -1082,12 -1120,10 +1106,13 @@@ class Mapper(object)
  
      def _is_userland_descriptor(self, obj):
          return not isinstance(obj, 
 -                    (MapperProperty, attributes.InstrumentedAttribute)) and \
 -                    hasattr(obj, '__get__')
 +                    (MapperProperty, attributes.QueryableAttribute)) and \
 +                    hasattr(obj, '__get__') and not \
 +                     isinstance(obj.__get__(None, obj),
 +                                    attributes.QueryableAttribute)
 +        
-     def _should_exclude(self, name, assigned_name, local):
+     def _should_exclude(self, name, assigned_name, local, column):
          """determine whether a particular property should be implicitly
          present on the class.
  
Simple merge
Simple merge
Simple merge
Simple merge