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)


Once this is done, we can return to using regular mapper() functions
rather than assign_mapper, and all query operations can move to .query.

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.

--
Jonathan LaCour
http://cleverdevil.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
-~----------~----~----~----~------~----~------~--~---

Reply via email to