Skip to content

Question related to the allocate model function #314

Open
@cgabard

Description

@cgabard

Hello.

Sorry if my question seems naive or if I missed something from the book. But I have difficulty understanding how the allocation is really committed to the db level. It is the only thing I have difficulty to understand in your book that is very interesting.

If I used the last version of the code (on master):

This code should persist the added OrderLine so, in order to commit this change, I guess that it is SQLAlchemy mapping magic that ensures the persistence of this change? Is it correct?

If so, I have another question. This behavior rely on some SQLAlchemy black magic. If I want to avoid them and did not use the mapper, to have an explicit committing line, I am not sure how I should implement it. Where update generated by the domain model should be added? Domain model does not have any direct link to the underlying repository used.

Basically, if I used raw SQL or basic sqlalchemy core api (without mapper), where model update sql statement should be added in the code base?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions