diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 17:48:29 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-03-17 17:48:29 -0400 |
| commit | 065fcbd9d2b463920d439c20d99a5a1cd7f216ed (patch) | |
| tree | 2230349df4cc7bc884f128e2c463c2e334152b7e /examples/custom_attributes | |
| parent | 95c0214356a55b6bc051d2b779e54d6de7b0b22e (diff) | |
| download | sqlalchemy-065fcbd9d2b463920d439c20d99a5a1cd7f216ed.tar.gz | |
- The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term. relation() however will remain available
in equal capacity for the foreseeable future. [ticket:1740]
Diffstat (limited to 'examples/custom_attributes')
| -rw-r--r-- | examples/custom_attributes/custom_management.py | 4 | ||||
| -rw-r--r-- | examples/custom_attributes/listen_for_events.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/custom_attributes/custom_management.py b/examples/custom_attributes/custom_management.py index 3c80183e2..0ffd0db4b 100644 --- a/examples/custom_attributes/custom_management.py +++ b/examples/custom_attributes/custom_management.py @@ -11,7 +11,7 @@ with a custom attribute system as well. """ from sqlalchemy import (create_engine, MetaData, Table, Column, Integer, Text, ForeignKey) -from sqlalchemy.orm import (mapper, relation, create_session, +from sqlalchemy.orm import (mapper, relationship, create_session, InstrumentationManager) from sqlalchemy.orm.attributes import set_attribute, get_attribute, del_attribute, is_instrumented @@ -161,7 +161,7 @@ if __name__ == '__main__': pass mapper(A, table1, properties={ - 'bs':relation(B) + 'bs':relationship(B) }) mapper(B, table2) diff --git a/examples/custom_attributes/listen_for_events.py b/examples/custom_attributes/listen_for_events.py index 3264b0246..0ae4d8fed 100644 --- a/examples/custom_attributes/listen_for_events.py +++ b/examples/custom_attributes/listen_for_events.py @@ -40,7 +40,7 @@ class AttributeListener(AttributeExtension): if __name__ == '__main__': from sqlalchemy import Column, Integer, String, ForeignKey - from sqlalchemy.orm import relation + from sqlalchemy.orm import relationship from sqlalchemy.ext.declarative import declarative_base class Base(object): @@ -61,7 +61,7 @@ if __name__ == '__main__': id = Column(Integer, primary_key=True) data = Column(String(50)) related_id = Column(Integer, ForeignKey("related.id")) - related = relation("Related", backref="mapped") + related = relationship("Related", backref="mapped") def __str__(self): return "MyMappedClass(data=%r)" % self.data |
