the first error is because declarative isn't smart enough to figure out
this many __abstract__ flags, and I'd support efforts to improve this.
But if you pass __abstract__ = False in a few places that gives it the
clues it needs to get to the second case (as well as removing the
__abstract__ =
Adding __abstract__ = True to the AbstractCoupe did seem to resolve those
errors, but it gave me a new one:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
from
I think it's OK to add __abstract__ to those mixins, in this case it
seems like the (pretty complicated) class graph is adding up to
something that causes declarative to see AbstractCar as mapped class
thus a "car" table is added. Adding __abstract__ to AbstractCoupe seems
to resolve.
On
I implemented the changes you suggested, but I am running into errors with
some polymorphic relations. Using a different theme, here is an example:
class AbstractVehicle(object):
__tablename__ = "vehicles"
id = Column(Integer, primary_key=True)
name = Column(String, nullable=False)
On 06/22/2016 04:53 PM, Angie Ellis wrote:
Mike,
Thank you for the response! I do have control over the external library.
I like your idea having both the abstract classes and concrete classes
available in the library because I have use cases for both in my
applications. However, I'm not
Mike,
Thank you for the response! I do have control over the external library. I
like your idea having both the abstract classes and concrete classes
available in the library because I have use cases for both in my
applications. However, I'm not quite sure how to configure the inheritance
and
On 06/03/2016 02:44 PM, Angie E wrote:
Rather than creating mixin classes that models inherit from, I have a
use case that requires me to configure classes the other way around. The
classes that would normally be mixin classes need to be the classes that
inherit from the models as well as the
Rather than creating mixin classes that models inherit from, I have a use
case that requires me to configure classes the other way around. The
classes that would normally be mixin classes need to be the classes that
inherit from the models as well as the class that model objects are created