You received this message because you are subscribed to the Google Groups "peewee-orm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to peewee-orm+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/peewee-orm/dfa8b35e-f3c8-dc20-0f45-17d6ab591915%40gmail.com.
Thank you for your prompt answer. To tell you the truth, I'm not a huge fan of SQLAlchemy's syntax, in particular regarding queries. What Peewee offers seems much more intuitive to use, at least in my opinion.
Would it be any possible to play with the Model class, say, if I inherit from it while replacing some behavior? The call to some special methods is involved after all, and I'm not against creating a basic ID mapper if that comes to that.
Also I've realized part of the problem for me is that I store objects beyond a transaction. For instance I tend to cache the location of characters (characters or locations are defined in the database, somewhat loosely because, again, either can be a different class). So that if char1.location calls the database each time, it might prove a bit problematic. Perhaps, however, I can manage to cache first call to char1.location in the transaction, and end the cache when the transaction ends, to avoid problems. Some engines do not mind if we store objects beyond a transaction, as long as we "don't modify them", but it might create synchronization issues, where an old "cached" object has some fields set but the actual store object in database has others. Again, an ID mapper here would solve this, as there is only one object to represent a single row, and modifying one calls an update on the database. Therefore, if it's not too much trouble creating an ID mapper (if, in fact, this is possible with Peewee) I wouldn't mind trying. If not possible, I'll have to weight whether the absence of an ID mapper would make things too difficult and changing ORM would be necessary, or whether I can work without ID mappers.
Thanks again for your answer,
To view this discussion on the web visit https://groups.google.com/d/msgid/peewee-orm/CAPukbqzv4XVmLYU2FjwUVG6hXtL9YRqh%3DhfjAOu4%2BSbc%3Ds%2Bgnw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/peewee-orm/db618d9f-4f91-bea2-f223-b39b51b7eb72%40gmail.com.