diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-27 16:44:34 -0400 | 
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-08-27 16:44:34 -0400 | 
| commit | 656cb6461b264935027580a32ce3820a7d73bd7e (patch) | |
| tree | 49f1489773a87e3bc8542e53f6d58ceb0386fa2e /lib/sqlalchemy/ext/declarative/api.py | |
| parent | 640625bc9e98dd4060a1e61c717ddc98f8b3808b (diff) | |
| download | sqlalchemy-656cb6461b264935027580a32ce3820a7d73bd7e.tar.gz | |
- [feature] declared_attr can now be used with
attributes that are not Column or MapperProperty;
including any user-defined value as well
as association proxy objects.  [ticket:2517]
Diffstat (limited to 'lib/sqlalchemy/ext/declarative/api.py')
| -rw-r--r-- | lib/sqlalchemy/ext/declarative/api.py | 11 | 
1 files changed, 6 insertions, 5 deletions
| diff --git a/lib/sqlalchemy/ext/declarative/api.py b/lib/sqlalchemy/ext/declarative/api.py index 143468c13..1a73e4f6d 100644 --- a/lib/sqlalchemy/ext/declarative/api.py +++ b/lib/sqlalchemy/ext/declarative/api.py @@ -101,11 +101,6 @@ class declared_attr(interfaces._MappedAttribute, property):      """Mark a class-level method as representing the definition of      a mapped property or special declarative member name. -    .. versionchanged:: 0.6.{2,3,4} -        ``@declared_attr`` is available as -        ``sqlalchemy.util.classproperty`` for SQLAlchemy versions -        0.6.2, 0.6.3, 0.6.4. -      @declared_attr turns the attribute into a scalar-like      property that can be invoked from the uninstantiated class.      Declarative treats attributes specifically marked with @@ -146,6 +141,12 @@ class declared_attr(interfaces._MappedAttribute, property):                  else:                      return {"polymorphic_identity":cls.__name__} +    .. versionchanged:: 0.8 :class:`.declared_attr` can be used with +       non-ORM or extension attributes, such as user-defined attributes +       or :func:`.association_proxy` objects, which will be assigned +       to the class at class construction time. + +      """      def __init__(self, fget, *arg, **kw): | 
