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!
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):
Allocatecommand is raise, the allocate handler is called and theproduct.allocatemethod is called.product.allocatemethod from the domain select a batch and call the corresponding batch method is called.OrderLineto the_allocationsset.This code should persist the added
OrderLineso, 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!