Hi all,

I am having trouble deferring a many-to-many mapping. I just had a couple 
of questions related there-to:

(1) The most visible implementations of vanilla many-to-many mappings seem 
to use sqlalchemy.Table(...). Is that, indeed, the accepted practice? One 
alternative would be to use a mapped class, but that seems less than 
parsimonious.

(2) There don't appear to be any particularly visible examples of deferred 
many-to-many mappings. The best I was able to come up with was along the 
lines of

class DeferredManyToMany(object):
     @declared_attr
     def __table__(cls):
          return Table(cls.__tablename__, cls.metadata, ....)

Is this also accepted practice?

(3) Upon execution, the __table__(...) method gets called twice and throws 
an InvalidRequestError saying the table is already defined. Giving 
extend_existing=True in the Table constructor fixes things. Can somebody 
provide some background on that?

(4) Now I'm trying to add a PrimaryKeyConstraint and things are going to 
crap again. See http://pastebin.com/1tQEWh71 . Is there some additional 
magic that I'm missing?

I'm on sqlalchemy 0.9.7.

Thanks!
~br

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to