def with_polymorphic(base, classes, selectable=False, flat=False, polymorphic_on=None, aliased=False, innerjoin=False, _use_mapper_path=False):
 primary_mapper = _class_to_mapper(base)
 (mappers, selectable) = primary_mapper._with_polymorphic_args(classes, selectable, innerjoin=innerjoin)
 if (aliased or flat):
  selectable = selectable.alias(flat=flat)
 return AliasedClass(base, selectable, with_polymorphic_mappers=mappers, with_polymorphic_discriminator=polymorphic_on, use_mapper_path=_use_mapper_path)

def with_polymorphic ( base , classes , selectable = False , flat = False , polymorphic_on = None , aliased = False , innerjoin = False , _use_mapper_path = False ) : primary_mapper = _class_to_mapper ( base ) ( mappers , selectable ) = primary_mapper . _with_polymorphic_args ( classes , selectable , innerjoin = innerjoin ) if ( aliased or flat ) : selectable = selectable . alias ( flat = flat ) return AliasedClass ( base , selectable , with_polymorphic_mappers = mappers , with_polymorphic_discriminator = polymorphic_on , use_mapper_path = _use_mapper_path )
produce an :class: .