Afternoon Guys,

 

In my classic non-orm based applications I would usually inject other
business object instances into my classes for such things as logging,
emailing and all manner of other things. For instance:

 

class foo:

    

    def __init__(self, logger, email_service, foo_id="", foo_firstname=""):

        self.logger = logger

        self.email_service = email_service

        self.foo_id = foo_id

        self.foo_firstname = foo_firstname

 

Now that I'm using the ORM I ask the ORM for these objects, however, it
obviously just hands me back an instance with all its properties loaded from
the database, what is essentially a glorified dict or 'dumb' object.

 

How would you go about getting these business objects into the objects
returned by the ORM? Would you have your service layer set them before
returning the object? Or can we somehow configure the ORM to do it for us?

 

Thanks guys, I'm really enjoying this.

 

Heston


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to