naktinis wrote: > > I've seen that Session.mapper is deprecated. While I agree that auto- > adding objects to a session may be a bad idea, I don't see why is it > so bad to add the query() method directly to the mapped class. > > Is there a reason, why I shouldn't do it?
you are free to do it, using a recipe that you tailor to your own needs, where you are responsible for resolving any undesire side effects. SQLA just doesn't want it in core since it is too confusing of a feature to be part of what's shipped. Here is the recipe: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper just add "Session.add(self)" to the __init__ decorator to get the auto-add thing. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
