1. Andrew Martinez
  2. sqlalchemy


Mike Bayer  committed 42edc92 Merge

merge default

  • Participants
  • Parent commits 58aed2c, e7b8b9c
  • Branches rel_0_8

Comments (0)

Files changed (2)

File doc/build/orm/inheritance.rst

View file
  • Ignore whitespace
         __tablename__ = 'company'
         id = Column(Integer, primary_key=True)
         name = Column(String(50))
         employees = relationship("Employee",
                         cascade='all, delete-orphan')
     class Employee(Base):
         __tablename__ = 'employee'
         id = Column(Integer, primary_key=True)
         company_id = Column(Integer, ForeignKey('company.id'))
         __mapper_args__ = {
-            'polymorphic_identity':employee',
+            'polymorphic_identity':'employee',
     class Engineer(Employee):
         __tablename__ = 'engineer'
         id = Column(Integer, ForeignKey('employee.id'), primary_key=True)
+        engineer_info = Column(String(50))
         __mapper_args__ = {'polymorphic_identity':'engineer'}
     class Manager(Employee):
         __tablename__ = 'manager'
         id = Column(Integer, ForeignKey('employee.id'), primary_key=True)
+        manager_data = Column(String(50))
         __mapper_args__ = {'polymorphic_identity':'manager'}
 When querying from ``Company`` onto the ``Employee`` relationship, the
 is converted into an aliased subquery.  Some backends, such as SQLite and older
 versions of MySQL can't handle a FROM clause of the following form::
-    FROM x JOIN (y JOIN z ON <onclause>) ON <onclause>`` - using ``aliased=True
+    FROM x JOIN (y JOIN z ON <onclause>) ON <onclause>
 Using ``aliased=True`` instead renders it more like::

File lib/sqlalchemy/ext/declarative/__init__.py

View file
  • Ignore whitespace
 primaryjoin, order_by etc. expressions should use the string forms
 for these arguments, so that they are evaluated as late as possible.
 To reference the mixin class in these expressions, use the given ``cls``
-to get it's name::
+to get its name::
     class RefTargetMixin(object):