Skip to content Skip to sidebar Skip to footer

Using A Custom Collection Extending From A Dict() With SqlAlchemy

I'm trying to use a custom collection to 'connect' (or relate) two classes but I haven't been able to do it. Maybe I got the whole concept of the SqlAlchemy custom collections wron

Solution 1:

Got it.

I had also asked the same question in the SqlAlchemy google group and I just got an answer.

http://groups.google.com/group/sqlalchemy/msg/5c8fc09a75fd4fa7

Quote:

So this is incorrect - collection_class takes a class or other callable as an argument that will produce an instance of your collection. The ZepConnector source you have below indicates that ZepConnector("VR") is an instance of the collection. You need to use a lambda: there. The other errors you're getting would appear to extend from that (and is also why init is called on ZepConnector - you're calling it yourself).

Thanks to Michael Bayer (and to all the people that tried to help, even by reading such a humongous post)


Post a Comment for "Using A Custom Collection Extending From A Dict() With SqlAlchemy"