All the declarative examples have DeclarativeBase as the first/left base
class. Does it need to be? I've swapped it in several code locations and
experimented and it seems to be fine, but there's a lot going on with
declarative and I'm vaguely paranoid about messing it up subtly by altering
the MRO.
ie: This is "normal", and is how all declarative examples are done:
class Foo(Base, MyMixin):
#snip
but is this also ok, or will it cause issues somehow?
class Foo2(MyMixin, Base):
#snip
The reason I'm looking at this is that I've got a case with multiple mixin
classes, and when the "top" mixin used doesn't have an __init__ definition,
but a lower level class does, having the declarative base first fails
because it doesn't use a (*args, **kwargs) catchall. I also wonder how
super() will end up working out.
Since that last bit probably wasn't very clear, here is a small but full
example of what I mean:
http://static.inky.ws/syn/335
Resolving the __init__ args issue is resolved by putting the Mixin first. I
just want to make sure it is fine.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/N4xewJ_5RJQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.