[sqlalchemy] Announcing API Logic Server

2021-07-19 Thread Val Huber
You may be interested in ApiLogicServer , open source on Git. With 1 command, it creates a customizable project providing a JSON:API, and a Basic Web App. These are based on SQLAlchemy, so it uses sqlacodegen to create your model classes.

Re: [sqlalchemy] sqlalchemy.exc.InvalidRequestError: Can't attach instance another instance with key is already present in this session

2021-07-19 Thread Mike Bayer
This is all expected behavior, the main reason you're having problems is that you are using multiple sessions and mixing their results together.If you need to do this, there are few approaches, the most basic being to use the merge() method:

[sqlalchemy] sqlalchemy.exc.InvalidRequestError: Can't attach instance another instance with key is already present in this session

2021-07-19 Thread Evgenii
Hello! I’m using many-to-many relation, and this relationship bar_list must have list of instances. Some of them can be repeated (ex. [inst1, inst2, inst1]). I attach very simplified code there (all of database interaction is hidden under the hood, user accesses database at top level, but this