1. Michael Bayer
  2. sqlalchemy
  3. Issues


Issue #2226 resolved

mixin columns blown away by the mapped columns on joined inh

Michael Bayer
repo owner created an issue
from sqlalchemy import Column, String, ForeignKeyConstraint, Integer
from sqlalchemy.ext.declarative import declarative_base, declared_attr

class TableName(object):
   def __tablename__(cls):
       return cls.__name__


class TMixin(object):

   def user(cls):
       return Column(String, primary_key=True)

   def timestamp(cls):
       return Column(Integer, autoincrement=False, primary_key=True)

class Timeline(TMixin, Base):

   snaptype = Column(Integer, primary_key=True, autoincrement=False)

   __mapper_args__ = {'polymorphic_on': snaptype}

class CMixin(TMixin):

   def __table_args__(cls):
       return (ForeignKeyConstraint(

   def __mapper_args__(cls):
       return {'polymorphic_identity': CMixin.__subclasses__().index(cls)}

class C(CMixin, Timeline):


Comments (2)

  1. Log in to comment