On 7/24/07, Jonathan LaCour <[EMAIL PROTECTED]> wrote: > Gaetan de Menten wrote: > > > Hmm, this proves more difficult than I thought. We can't have a query > > property because then assign_mapper fails (it tries to monkeypatch > > the class and fails). And changing assign_mapper to include a simple > > has_attr doesn't seem to work either because I'm using a property on > > the metaclass, not an attribute on the class itself. The only "clean" > > solution I can think of to actually get a .query attribute is to get > > rid of assign_mapper entirely (the unclean one being to monkeypatch > > the class ourselves). > > Well, its better to handle this now than later! One way to get rid of > assign_mapper would be this: > > from sqlalchemy.orm.mapper import global_extensions > from elixir import objectstore > global_extensions.append(objectstore.context.mapper_extension)
Didn't know that trick. But this doesn't really help. We can simply call the regular mapper() function with the session_context extension. And while we are here, I'd like to provide an option to not use the session_context extension at all. > Once this is done, we can return to using regular mapper() functions > rather than assign_mapper, and all query operations can move to .query. Easy enough but what do we do with all those methods? I think we should still provide those methods (with a deprecated warning), at least for a few releases to provide for a nice upgrade path. What about the methods which are also deprecated in Query (get_by, select, ...)? > This is a big change, but it seems like it should happen in a major > version bump like 0.4. We'll just need to make sure to update our docs > and tutorials, and include a note about it in the announcement. Sure. -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SQLElixir" 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/sqlelixir?hl=en -~----------~----~----~----~------~----~------~--~---
