forked from pool/python-sortinghat
- version update to 0.7.19 * no minor version changelog found - modified patches % no_decl_class_registry.patch (refreshed) - python-mock is not required for build OBS-URL: https://build.opensuse.org/request/show/971075 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sortinghat?expand=0&rev=23
19 lines
651 B
Diff
19 lines
651 B
Diff
---
|
|
sortinghat/db/database.py | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
--- a/sortinghat/db/database.py
|
|
+++ b/sortinghat/db/database.py
|
|
@@ -258,7 +258,7 @@ def reflect_table(engine, klass):
|
|
def find_model_by_table_name(name):
|
|
"""Find a model reference by its table name"""
|
|
|
|
- for model in ModelBase._decl_class_registry.values():
|
|
- if hasattr(model, '__table__') and model.__table__.fullname == name:
|
|
- return model
|
|
- return None
|
|
+ for value in ModelBase.registry._class_registry.values():
|
|
+ if getattr(value, '__tablename__', None) == name:
|
|
+ return value
|
|
+ return None
|