On 12 фев, 00:55, Michael Bayer <mike...@zzzcomputing.com> wrote:
> yeah, youre using it exactly for what you should not be using it for,
> to approximate the save() method on an active-record system.
> building your whole app around a fake save() paradigm is not at all
> how SQLA's unit of work was designed.  You can of course create your
> own CRUD system to issue inserts/updates yourself but then you dont
> get all the benefits of the UOW.   this makes me more sure of
> deprecating it.

Yeah, now it's all a bit more clear for me...

> > If so, what do you think about some kind of async events system?
> > Something like PyDispatcher, Louie or Django's dispatch. It can be
> > used not only with mapper's events but also with ddl-events. The main
> > pro of this approach is the ability to subscribe to (or unsubscribe
> > from) such events in run-time.
>
> the ORM and the schema system are two totally different systems.  
> MapperExtension and SessionExtension handle ORM events.  the DDL()  
> object handles DDL events.  The MapperExtension/SessionExtension can  
> easily be used to create an on-events system based on object  
> signature, like __on_save__(), etc.  Extensions can also be set at any  
> time by saying mapper.extension.append(yourext), similar for Session.

I understand that schema and orm has no similar. I spoke about events
system which can be absolutely sender-reciever agnostic.

Btw, after all I may agree with deprecation of flush([obj]) feature...
And I'll rewrite my apps' db-part to be native for UOW and not to
emulate active-record... (But it seems to me now that I'll use only
one extension for each mapper which will be the bridge to dispatching
system like PyDispatcher, because to call `connect(post_save,
post_save_handler)` is much more simpler than to declare and append
extension...)

--
Angri
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to