I read it, but could you illustrate it with a sample code based on the classic User/Addresses example?
On Wednesday, June 25, 2014 11:45:12 AM UTC-4, Jonathan Vanasco wrote: > > > On Tuesday, June 24, 2014 9:40:02 PM UTC-4, Victor Olex wrote: >> >> What I aiming for is to provide users a library of base class(es), which >> are mapped using SQLAlchemy. The classes are then meant to be extended by >> users with business logic. I am not hell bent on using inheritance for >> this, but for now I went with your __abstract__ = True solution only in a >> somewhat inverted way. >> > > There's another thread from within the past 2 weeks from someone else > trying to tackle this problem. > > I mentioned in that post, and I'll mention again here -- the best method I > found was to use a form of a "registry" pattern -- where child classes > inherit from base class and mention any overrides + the types of > relationships they require or provide. As the classes are initialized, this > data is recorded in a registry. after initialization, relationships are > mapped onto the classes uses the data in the registry. > > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.