On Fri, Sep 28, 2018 at 9:41 PM seaders wrote:
>
> I'm writing some tests for my system, and I have all the objects that I
> *would* be getting from the database, as flat json files, which I then load
> up from, to SQLAlchemy files for my tests.
>
> I've all that working fine, but the one place
I'm writing some tests for my system, and I have all the objects that I
*would* be getting from the database, as flat json files, which I then load
up from, to SQLAlchemy files for my tests.
I've all that working fine, but the one place I'd like to improve is
"gluing" them back together /
Thank you very much for such a detailed answer.
I am happy that everything works as it should.
пятница, 21 сентября 2018 г., 19:02:43 UTC+3 пользователь Mike Bayer
написал:
>
> On Fri, Sep 21, 2018 at 10:52 AM Алексанр Платонов
> > wrote:
> >
> > Hi, with all due respect, I copy here the link
the exception you describe is not raised at mapping time, it's raised
at collection assignment time, which would indicate the relationship
you are attempting to assign towards was not defined with
collection_class=set. Please provide complete detail including full
MCVE and complete stack trace,
Is that the "set" python built-in? Is it possible the word "set" was
redefined ? Because that is the correct usage and it does not raise that
error for the "set" builtin
On Fri, Sep 28, 2018, 6:55 AM wrote:
> I'd like to do something like:
>
>
> children = relationship("Child",
I'd like to do something like:
children = relationship("Child", secondary=association_table,
collection_class=set)
But I get: *TypeError: Incompatible collection type: set is not list-like*
Is there a way to achieve it or set is not compatible with many-to-many
relationship?
--