- changed status to resolved
simplify entity_name
Issue #1112
resolved
We're going to reduce entity_name to this:
mapper(Foo, foo_table, entity_name="bar")
.... in mapper:
# make our own subclass for this entity_name
self.class_ = type("Foo", (Foo,) {})
f = Foo()
session.add(f, entity_name="bar")
... in Session:
# change the class of the incoming object
cls = class_mapper(f.__class__, entity_name="bar").class_
f.__class__ = cls
foo_entity = entity(Foo, entity_name="bar")
sess.query(foo_entity).filter(foo_entity.id==5)
... in entity()
# return class_mapper(Foo, entity_name="bar").class_
the step where we call type()
also needs to take the class' metaclass into account.
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
change of plans. entity_name is removed in d28ba32271f5394bda15383ec5277ede0737c01b. rationale is listed on the google group.