Thanks for answer.
Problem is too much loading time (~40 seconds) if i use standart
declaration.
To resolve this,
i define classes when they called (write class factory), but on factory i
cannot redefine func to get relationship value if return non-main class
(such as child)
Realization is
def handle_assertion_error(self, err_info):
result = re.match(
"^No such polymorphic_identity '(.*)' is defined$", str(err_info))
if result.groups() is None:
raise DBException(str(err_info))
for class_name in class_factory.all_classes_list:
if (class_name.lower() == result.groups()[0]):
getattr(class_factory, class_name)
return
With child of *sqlalchemy.orm.query.Query* class i override methods *all*,
and *__getitem__ *and now query works
But that is not good for orm objects such is *Organisation.Users*, need to
use this handler for all queries
I ask how can i pass handler to sqlalchemy?
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.